mirror of https://github.com/mkerrisk/man-pages
prctl.2: Improve description of PR_SET_CHILD_SUBREAPER
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
d59a75720f
commit
fbc639312f
17
man2/prctl.2
17
man2/prctl.2
|
@ -161,16 +161,17 @@ if
|
||||||
.I arg2
|
.I arg2
|
||||||
is zero, unset the attribute.
|
is zero, unset the attribute.
|
||||||
|
|
||||||
When a process is marked as a child subreaper,
|
A subreaper fulfills the role of
|
||||||
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
|
|
||||||
.BR init (1)
|
.BR init (1)
|
||||||
for its descendant processes.
|
for its descendant processes.
|
||||||
Upon termination of a process
|
When a process becomes orphaned
|
||||||
that is orphaned (i.e., its immediate parent has already terminated)
|
(i.e., its immediate parent terminates)
|
||||||
and marked as having a subreaper,
|
then that process will be reparented to
|
||||||
the nearest still living ancestor subreaper
|
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
|
will receive a
|
||||||
.BR SIGCHLD
|
.BR SIGCHLD
|
||||||
signal and will be able to
|
signal and will be able to
|
||||||
|
|
Loading…
Reference in New Issue