summaryrefslogtreecommitdiffstats
path: root/man/man2/gettid.2
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-24 04:52:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-24 04:52:22 +0000
commit3d08cd331c1adcf0d917392f7e527b3f00511748 (patch)
tree312f0d1e1632f48862f044b8bb87e602dcffb5f9 /man/man2/gettid.2
parentAdding debian version 6.7-2. (diff)
downloadmanpages-3d08cd331c1adcf0d917392f7e527b3f00511748.tar.xz
manpages-3d08cd331c1adcf0d917392f7e527b3f00511748.zip
Merging upstream version 6.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'man/man2/gettid.2')
-rw-r--r--man/man2/gettid.274
1 files changed, 74 insertions, 0 deletions
diff --git a/man/man2/gettid.2 b/man/man2/gettid.2
new file mode 100644
index 0000000..fa1fb2c
--- /dev/null
+++ b/man/man2/gettid.2
@@ -0,0 +1,74 @@
+.\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
+.\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH gettid 2 2024-05-02 "Linux man-pages (unreleased)"
+.SH NAME
+gettid \- get thread identification
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " \-lc )
+.SH SYNOPSIS
+.nf
+.B #define _GNU_SOURCE
+.B #include <unistd.h>
+.P
+.B pid_t gettid(void);
+.fi
+.SH DESCRIPTION
+.BR gettid ()
+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
+.B CLONE_THREAD
+in
+.BR clone (2).
+.SH RETURN VALUE
+On success, returns the thread ID of the calling thread.
+.SH ERRORS
+This call is always successful.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 2.4.11,
+glibc 2.30.
+.SH NOTES
+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)).
+.P
+In a new thread group created by a
+.BR clone (2)
+call that does not specify the
+.B 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),
+.BR fcntl (2),
+.BR fork (2),
+.BR get_robust_list (2),
+.BR getpid (2),
+.\" .BR kcmp (2),
+.BR ioprio_set (2),
+.\" .BR move_pages (2),
+.\" .BR migrate_pages (2),
+.BR perf_event_open (2),
+.\" .BR process_vm_readv (2),
+.\" .BR ptrace (2),
+.BR sched_setaffinity (2),
+.BR sched_setparam (2),
+.BR sched_setscheduler (2),
+.BR tgkill (2),
+.BR timer_create (2)