linked lists linux kernel how they works?

K

kernel.lover

Hello,
In kernel source in list.h i found following info
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name)
What i want to know is how LIST_HEAD_INIT(name)
evaluted? what will first definition return to second one?
regards,
cranium
 
B

Ben Pfaff

In kernel source in list.h i found following info
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name)
What i want to know is how LIST_HEAD_INIT(name)
evaluted? what will first definition return to second one?

LIST_HEAD_INIT is an initializer for a struct list_head. You use
it in a declaration.

LIST_HEAD declares a struct list head and initializes it using
LIST_HEAD_INIT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,293
Latest member
BonnieHamb

Latest Threads

Top