In Linux Kernel Development, 3rd ed, this code was given for traversing the children of the current process.
list_for_each(list, ¤t->children) {
task = list_entry(list, struct task_struct, sibling);
/* task now points to one of current’s children */
}
The "sibling" in this idiom looks out of place. What is its purpose?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…