I am trying to add a system call to my linux kernel, and it would be useful to use the built-in linked list as I modify task_struct (by adding a linked list), and task_struct already has quite a few struct list_head there for other purposes. For consistency, I would like to adhere to this data structure.
My problem is that I really don't quite understand how to use this structure. I see that they have a "struct list_head children", for example. However, the implementation of this structure is simple: "* next" and "* last".
I looked at examples on the Internet, and each of them says do well
struct node{
int data;
struct list_head list;
};
But does this mean that the data structure that I should include in my task_struct should be
struct node list;
?
, , , , , list_head.
, char * ( ).
... , , task_struct.
: , :
, . char *. task_struct, .
'abc'
printf ~ > "WriteScreen"
getchar ~ > "ReadKey"
, . , ( ), "" .
task_struct 'abc'
abc- > task_struct- > tag_list
"WriteScreen" "ReadKey".
, WriteScreen, ReadKey .. , , , .