]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Rewrote DESCRIPTION; noted that thread ID is not the same
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 12 Jan 2008 12:43:44 +0000 (12:43 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 12 Jan 2008 12:43:44 +0000 (12:43 +0000)
thing as a POSIX thread ID.

man2/gettid.2

index 3c90a409066458d72a1bcb3f0e335311485456cd..4d1c9e21f41b56d3b2c89fff0aa610c667f004ba 100644 (file)
@@ -1,6 +1,8 @@
 .\" Hey Emacs! This file is -*- nroff -*- source.
 .\"
 .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
+.\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -21,7 +23,7 @@
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
-.TH GETTID 2 2007-06-01 "Linux" "Linux Programmer's Manual"
+.TH GETTID 2 2008-01-12 "Linux" "Linux Programmer's Manual"
 .SH NAME
 gettid \- get thread identification
 .SH SYNOPSIS
@@ -32,18 +34,16 @@ gettid \- get thread identification
 .fi
 .SH DESCRIPTION
 .BR gettid ()
-returns the thread ID of the calling process.
-This is equal
-to the process ID (as returned by
-.BR getpid (2)),
-unless the process is part of a thread group (created by specifying
-the
-.B CLONE_THREAD
-flag to the
-.BR clone (2)
-system call).
-All processes in the same thread group
+returns the caller's thread ID (TID).
+In a single-threaded process, the thread ID
+is equal to the process ID (PID, as returned by
+.BR getpid (2)).
+In a multithreaded process, all threads
 have the same PID, but each one has a unique TID.
+For further details, see the discussion of
+.BR CLONE_THREAD
+in
+.BR clone (2).
 .SH "RETURN VALUE"
 On success, returns the thread ID of the calling process.
 .SH ERRORS
@@ -55,6 +55,10 @@ are intended to be portable.
 .SH NOTES
 Glibc does not provide a wrapper for this system call; call it using
 .BR syscall (2).
+
+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)).
 .SH "SEE ALSO"
 .BR clone (2),
 .BR fork (2),