gettid.2: Note that for a thread group leader, gettid() == getpid()

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-06-12 18:56:24 +02:00
parent ca48cef151
commit 4a8f718576
1 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,18 @@ Glibc does not provide a wrapper for this system call; call it using
The thread ID returned by this call is not the same thing as a
POSIX thread ID (i.e., the opaque value returned by
.BR pthread_self (3)).
In a new thread group created by a
.BR clone (2)
call that does not specify the
.BR CLONE_THREAD
flag (or, equivalently, a new process created by
.BR fork (2)),
the new process is a thread group leader,
and its thread group ID (the value returned by
.BR getpid (2))
is the same as its thread ID (the value returned by
.BR gettid ()).
.SH SEE ALSO
.BR capget (2),
.BR clone (2),