Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <linux/slab.h>
  2.  
  3. struct list_element
  4. {
  5.     void *data;                 // the payload
  6.     struct list_element *next;  // pointer to the next element
  7.     struct list_element *preV;  // pointer to the previous element
  8. };
  9.  
  10. int main()
  11. {
  12.     struct list_element *root;
  13.     root = kmalloc(sizeof(*root), GFP_KERNEL);
  14.     root -> data = 20;
  15.     root -> next = kmalloc(sizeof(*root), GFP_KERNEL);
  16.     root -> next = NULL;
  17.    
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement