Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/slab.h>
- struct list_element
- {
- void *data; // the payload
- struct list_element *next; // pointer to the next element
- struct list_element *preV; // pointer to the previous element
- };
- int main()
- {
- struct list_element *root;
- root = kmalloc(sizeof(*root), GFP_KERNEL);
- root -> data = 20;
- root -> next = kmalloc(sizeof(*root), GFP_KERNEL);
- root -> next = NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement