pid_namespaces.7: readlink(2) on /proc/self gives the caller's PID in the pidns of /proc

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2013-02-28 12:02:28 +01:00
parent 6e377abf9c
commit 6c3db75479
1 changed files with 7 additions and 0 deletions

View File

@ -234,6 +234,13 @@ then it isn't necessary to change the root directory:
a new procfs instance can be mounted directly over
.IR /proc .)
Calling
.BR readlink (2)
on the path
.I /proc/self
yields the process ID of the caller in the PID namespace of the procfs mount
(i.e., the PID namespace of the process that mounted the procfs).
When a process ID is passed over a UNIX domain socket to a
process in a different PID namespace (see the description of
.B SCM_CREDENTIALS