diff options
| -rw-r--r-- | man7/pid_namespaces.7 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/man7/pid_namespaces.7 b/man7/pid_namespaces.7 index 97c4fd6f15..5ef19a9265 100644 --- a/man7/pid_namespaces.7 +++ b/man7/pid_namespaces.7 @@ -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. .\" .\" ============================================================ .\" |
