.\" 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.
.\" 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
.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
.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),