How can I get the children process list in kernel code
问题 I want to get to the children task (process) list of a process, here is the code: void myFunc() { struct task_struct* current_task; struct task_struct* child_task; struct list_head children_list; current_task = current; children_list = current_task->children; child_task = list_entry(&children_list,struct task_struct,tasks); printk("KERN_INFO I am parent: %d, my child is: %d \n", current_task->pid,child_task->pid); } The current pid is right, but the child pid is not correct. What am I doing