explain notifier.c from the Linux kernel
Posted
by
apollon
on Stack Overflow
See other posts from Stack Overflow
or by apollon
Published on 2014-08-22T22:10:08Z
Indexed on
2014/08/22
22:20 UTC
Read the original article
Hit count: 137
I'm seeking to fully understand the following code snippet from kernel/notifier.c. I have read and built simple link lists and think I get the construct from K&R's C programming. The second line below which begins with the 'int' appears to be two items together which is unclear. The first is the (*notifier_call) which I believe has independent but related significance with the second containing a 'notifier block' term.
Can you explain how it works in detail? I understand that there is a function pointer and multiple subscribers possible. But I lack the way to tie these facts together, and could use a primer or key so I exactly understand how the code works. The third line looks to contain the linking structure, or recursive nature. Forgive my terms, and correct them as fit as I am a new student of computer science terminology.
struct notifier_block {
int (*notifier_call)(struct notifier_block *, unsigned long, void *);
struct notifier_block *next;
int priority;
};
© Stack Overflow or respective owner