struct list_head* list;
struct task_struct* t;
for(list = p->children.next; list!=&(p->children);list = list->next){
t=list_entry(list,struct task_struct,sibling);
get_procss_tree(t);
}
printkinfo("pid:%d-proc:%s\n" ,t->pid ,t->comm);
内核源文件:
linux/sched.h
kernel/sched.c