Advertisement
Tobiahao

SO2_LAB1_01

Mar 8th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. /* Zbadaj za pomoca operatora sizeof rozmiary typw danych opisanych w tabeli 2 */
  2.  
  3. #include <linux/module.h>
  4. #include <linux/types.h>
  5.  
  6. static int __init program_init(void)
  7. {
  8.     printk(KERN_ALERT "Zadanie 1 (3 punkty)\n");
  9.  
  10.     printk(KERN_DEFAULT "sizeof(s8) = %lu bajt\n", sizeof(s8));
  11.     printk(KERN_DEFAULT "sizeof(u8) = %lu bajt\n", sizeof(u8));
  12.     printk(KERN_DEFAULT "sizeof(s16) = %lu bajty\n", sizeof(s16));
  13.     printk(KERN_DEFAULT "sizeof(u16) = %lu bajty\n", sizeof(u16));
  14.     printk(KERN_DEFAULT "sizeof(s32) = %lu bajty\n", sizeof(s32));
  15.     printk(KERN_DEFAULT "sizeof(u32) = %lu bajty\n", sizeof(u32));
  16.     printk(KERN_DEFAULT "sizeof(s64) = %lu bajtow\n", sizeof(s64));
  17.     printk(KERN_DEFAULT "sizeof(u64) = %lu bajtow\n", sizeof(u64));
  18.     return 0;
  19. }
  20.  
  21. static void __exit program_exit(void)
  22. {
  23.     printk(KERN_ALERT "Koniec\n");
  24. }
  25.  
  26. module_init(program_init);
  27. module_exit(program_exit);
  28.  
  29. MODULE_AUTHOR("Tobiasz Nartowski <tobiasznartowski@gmail.com");
  30. MODULE_DESCRIPTION("Zadanie 1 (3 punkty)");
  31. MODULE_LICENSE("GPL");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement