I was surprised to discover that a process can have a parent that isn't
a thread group leader. (The usual ppid interfaces hide this, but the
children list exposes it.)
Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Cc: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
---
Documentation/filesystems/proc.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index fd8d0d5..205796a 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1623,6 +1623,12 @@ This file provides a fast way to retrieve first level children pids
of a task pointed by <pid>/<tid> pair. The format is a space separated
stream of pids.
+This really is a per-thread list. If a process's parent is a thread,
+then that process will appear in that thread's children list. (This
+means that, for any pid, /proc/pid/task/*/children are disjoint lists.)
+This may be surprising, as /proc/pid/status's PPid field is parent's
+tgid as opposed to the parent's tid.