daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 81 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. void *ptr = ((char*)l_p - (unsigned int)&((struct node_s*)0)->list);
  2.    
  3. struct node_s{
  4.     char a;
  5.     char b;
  6.     char c;
  7.     char d;
  8.     struct list_head list;
  9. };
  10.    
  11. (unsigned int)&((struct node_s*)0)->list
  12.    
  13. (struct node_s*)0
  14.    
  15. ((struct node_s*)0)->list
  16.    
  17. &((struct node_s*)0)->list;
  18.    
  19. (unsigned int)&((struct node_s*)0)->list
  20.    
  21. ((char*)l_p - (unsigned int)&((struct node_s*)0)->list)
  22.    
  23. void *ptr = (char*)l_p - offsetof(struct node_s, list);
  24.    
  25. void *ptr = container_of(l_p, struct node_s, list);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top