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.
|
or resides in the immediate parent PID namespace.
|
||||||
|
|
||||||
Every thread in a process must be in the same 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
|
.nf
|
||||||
unshare(CLONE_NEWPID);
|
unshare(CLONE_NEWPID);
|
||||||
|
@ -215,14 +216,16 @@ For this reason, the following call sequences will fail:
|
||||||
setns(fd, CLONE_NEWPID); /* Fails */
|
setns(fd, CLONE_NEWPID); /* Fails */
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
Because the above
|
The point here is that
|
||||||
.BR unshare (2)
|
.BR unshare (2)
|
||||||
and
|
and
|
||||||
.BR setns (2)
|
.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)
|
.BR clone (2)
|
||||||
calls necessarily put the new thread in a different PID namespace from
|
.BR CLONE_VM
|
||||||
the calling thread.
|
specifies the creation of a new thread in the same process.
|
||||||
.\"
|
.\"
|
||||||
.\" ============================================================
|
.\" ============================================================
|
||||||
.\"
|
.\"
|
||||||
|
|
Loading…
Reference in New Issue