prctl.2: Improve description of PR_SET_CHILD_SUBREAPER

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-03-16 08:26:24 +01:00
parent d59a75720f
commit fbc639312f
1 changed files with 9 additions and 8 deletions

View File

@ -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