From: Michael Kerrisk Date: Thu, 16 Mar 2017 07:26:24 +0000 (+0100) Subject: prctl.2: Improve description of PR_SET_CHILD_SUBREAPER X-Git-Tag: man-pages-4.11~300 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fbc639312f561f877cb7e51155d32d01c228740f;p=thirdparty%2Fman-pages.git prctl.2: Improve description of PR_SET_CHILD_SUBREAPER Signed-off-by: Michael Kerrisk --- diff --git a/man2/prctl.2 b/man2/prctl.2 index f48643b954..633a0eb176 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -161,16 +161,17 @@ if .I arg2 is zero, unset the attribute. -When a process is marked as a child subreaper, -all of the children that it creates, and their descendants, -will be marked as having a subreaper. -In effect, a subreaper fulfills the role of +A subreaper fulfills the role of .BR init (1) for its descendant processes. -Upon termination of a process -that is orphaned (i.e., its immediate parent has already terminated) -and marked as having a subreaper, -the nearest still living ancestor subreaper +When a process becomes orphaned +(i.e., its immediate parent terminates) +then that process will be reparented to +the nearest still living ancestor subreaper. +Subsequently, calls to +.BR getppid () +in the orphaned process will now return the PID of the subreaper process, +and when the orphan terminates, it is the subreaper process that will receive a .BR SIGCHLD signal and will be able to