-1
我是LKD的新手,我正在閱讀羅伯特·洛夫的書。我堅持瞭解如下一個概念。需要澄清在羅伯特·愛的Linux內核中給出的內容
同樣,也可以遍歷進程的孩子
struct task_struct *task;
struct list_head *list;
list_for_each(list, ¤t->children) {
task = list_entry(list, struct task_struct, sibling);
/* task now points to one of current’s children */
}
我也將是巨大的,如果有人解釋LIST_ENTRY論證工作?
我很難理解上面的代碼片段list_for_each
的作品。
您是否試過[查看](http://lxr.linux.no/linux+v3.12.1/include/linux/list.h#L375)? –
@larsmans是的,我也試過這個http://stackoverflow.com/questions/5550404/list-entry-in-linux,但我仍然沒有得到它。 – user2958183