From 57c80845d04e8497f7f9ed2b66ee87a5b77bbd91 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 28 Sep 2017 09:19:04 +0200 Subject: [PATCH] getpid.2: Mention that PID == TGID, and note contrast with TID Signed-off-by: Michael Kerrisk --- man2/getpid.2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/man2/getpid.2 b/man2/getpid.2 index e6c4d96fa..e894302fa 100644 --- a/man2/getpid.2 +++ b/man2/getpid.2 @@ -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,