mirror of https://github.com/mkerrisk/man-pages
pid_namespaces.7: Clarify text on failure cases with CLONE_VM + multithreaded
Reported-by: Rob Landley <rob@landley.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
837ddeb969
commit
47832b6dfc
|
@ -199,7 +199,8 @@ the parent of a process is either in the same namespace
|
|||
or resides in the immediate parent PID namespace.
|
||||
|
||||
Every thread in a process must be in the same PID namespace.
|
||||
For this reason, the following call sequences will fail:
|
||||
For this reason, the following call sequences will fail (with the error
|
||||
.BR EINVAL ):
|
||||
|
||||
.nf
|
||||
unshare(CLONE_NEWPID);
|
||||
|
@ -215,14 +216,16 @@ For this reason, the following call sequences will fail:
|
|||
setns(fd, CLONE_NEWPID); /* Fails */
|
||||
.fi
|
||||
|
||||
Because the above
|
||||
The point here is that
|
||||
.BR unshare (2)
|
||||
and
|
||||
.BR setns (2)
|
||||
calls only change the PID namespace for created children, the
|
||||
change the PID namespace for processes subsequently created by the caller,
|
||||
but not for the calling process,
|
||||
while
|
||||
.BR clone (2)
|
||||
calls necessarily put the new thread in a different PID namespace from
|
||||
the calling thread.
|
||||
.BR CLONE_VM
|
||||
specifies the creation of a new thread in the same process.
|
||||
.\"
|
||||
.\" ============================================================
|
||||
.\"
|
||||
|
|
Loading…
Reference in New Issue