![]() for better system diagnostics, we *ALWAYS* want to record the parent pid of a user process, regardless of if the child will post a wait record on exit or not. for that, we reverse the roles of Proc.parent and Proc.parentpid so Proc.parentpid will always be set on rfork() and the Proc.parent pointer will point to the parent's Proc structure or is set to nil when no wait record should be posted on exit (RFNOWAIT flag). this means that we can get the pid of the original parent process from /proc, regardless of the the child having rforked with the RFNOWAIT flag. this improves the output of pstree(1) somewhat if the parent is still alive. note that theres no guarantee that the parent pid is still valid. the conditions are unchanged: a user process that will post wait record has: up->kp == 0 && up->parent != nil && up->parent->pid == up->parentpid the boot process is: up->kp == 0 && up->parent == nil && up->parentpid == 0 and kproc's have: up->kp != 0 && up->parent == nil && up->parentpid == 0 |
||
---|---|---|
.. | ||
doc | ||
games/lib | ||
include | ||
lib | ||
man | ||
src |