getpid.2: Mention that PID == TGID, and note contrast with TID

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-09-28 09:19:04 +02:00
parent 80b435e1ba
commit 57c80845d0
1 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,18 @@ If the caller's parent is in a different PID namespace (see
.BR pid_namespaces (7)),
.BR getppid ()
returns 0.
.PP
From a kernel perspective,
the PID (which is shared by all of the threads in a multithreaded process)
is sometimes also known as the thread group ID (TGID).
This contrasts with the kernel thread ID (TID),
which is unique for each thread.
For further details, see
.BR gettid (2)
and the discussion of the
.BR CLONE_THREAD
flag in
.BR clone (2).
.\"
.SS C library/kernel differences
From glibc version 2.3.4 up to and including version 2.24,