diff options
author | Daniel Colascione <dancol@google.com> | 2018-11-05 08:22:05 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2018-11-20 11:50:00 -0500 |
commit | c969eb830175f42b6cc0c8e80f6fce452fd75788 (patch) | |
tree | 715766ff20b1b93fb88c8e4ca649ab3d415d870d | |
parent | 1428cc0e0c36de4f32b3de38ae497394dca6972b (diff) |
Document /proc/pid PID reuse behavior
State explicitly that holding a /proc/pid file descriptor open does
not reserve the PID. Also note that in the event of PID reuse, these
open file descriptors refer to the old, now-dead process, and not the
new one that happens to be named the same numeric PID.
Signed-off-by: Daniel Colascione <dancol@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/filesystems/proc.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index a078efad9957..af88fa238786 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -125,6 +125,13 @@ process running on the system, which is named after the process ID (PID). | |||
125 | The link self points to the process reading the file system. Each process | 125 | The link self points to the process reading the file system. Each process |
126 | subdirectory has the entries listed in Table 1-1. | 126 | subdirectory has the entries listed in Table 1-1. |
127 | 127 | ||
128 | Note that an open a file descriptor to /proc/<pid> or to any of its | ||
129 | contained files or subdirectories does not prevent <pid> being reused | ||
130 | for some other process in the event that <pid> exits. Operations on | ||
131 | open /proc/<pid> file descriptors corresponding to dead processes | ||
132 | never act on any new process that the kernel may, through chance, have | ||
133 | also assigned the process ID <pid>. Instead, operations on these FDs | ||
134 | usually fail with ESRCH. | ||
128 | 135 | ||
129 | Table 1-1: Process specific entries in /proc | 136 | Table 1-1: Process specific entries in /proc |
130 | .............................................................................. | 137 | .............................................................................. |