mirror of https://github.com/mkerrisk/man-pages
namespaces.7: Document PID namespace case where getppid() can return 0
getppid() can return 0 if parent is in a different namespace. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
7091f8f392
commit
110026abe4
|
@ -367,6 +367,22 @@ A call to
|
|||
always returns the PID associated with the namespace in which
|
||||
the process resides.
|
||||
|
||||
Some processes in a PID namespaces may have parents
|
||||
that are outside of the namespace.
|
||||
For example, the parent of the initial process in the namespace
|
||||
(i.e.,
|
||||
the
|
||||
.BR init (1)
|
||||
process with PID 1) is necessarily in another namespace.
|
||||
Likewise, the direct children of a process that uses
|
||||
.BR setns (2)
|
||||
to cause its children to join a PID namespace are in a different
|
||||
PID namespace from the caller of
|
||||
.BR setns (2).
|
||||
Calls to
|
||||
.BR getppid (2)
|
||||
for such processes return 0.
|
||||
|
||||
After creating a new PID namespace,
|
||||
it is useful for the child to change its root directory
|
||||
and mount a new procfs instance at
|
||||
|
|
Loading…
Reference in New Issue