简体   繁体   中英

What Is The Real Grand GRAND Ancestor Process In The Linux Kernel?

While trying to find all the roots of certain process application made in C, and calls a custom system call I made that returns an array of all the process using task_struct*'s info, I experienced that the task swapper/0 is the task that points to itself through the parent pointer (ie swapper/0->parent == swaper/0). My question is: Which one is the real grand GRAND parent of any process running in the user space? is it swapper/0 or the task right before it (or swapper/0's child)? Ie is swapper/0 is meant to be a real task, or just an ending flag for traversing the parent linked lists?

Btw, this question extends the question posted by me in this post: The ending flag to traversing ancestors in the kernel space in C .

init (pid 1) is the process which is the ancestor of all other user processes. init is responsible for starting up all of the user-level processes that run the system. Furthermore, a process whose parent exits is inherited by init (ie, init becomes its parent).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM