]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org> | |
4 | .\" Permission is granted to make and distribute verbatim copies of this | |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
12 | .\" | |
13 | .\" Since the Linux kernel and libraries are constantly changing, this | |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
20 | .\" | |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
23 | .\" | |
24 | .TH GETTID 2 "2003-02-01" "Linux 2.4.20" "Linux Programmer's Manual" | |
25 | .SH NAME | |
26 | gettid \- get thread identification | |
27 | .SH SYNOPSIS | |
28 | .B #include <sys/types.h> | |
29 | .br | |
30 | .B #include <linux/unistd.h> | |
527d9933 | 31 | .B #include <errno.h> |
fea681da MK |
32 | .sp |
33 | .B _syscall0(pid_t,gettid) | |
34 | .sp | |
35 | .B pid_t gettid(void); | |
36 | .SH DESCRIPTION | |
37 | \fBgettid\fP returns the thread ID of the current process. This is equal | |
38 | to the process ID (as returned by | |
39 | .BR getpid (2)), | |
40 | unless the process is part of a thread group (created by specifying | |
41 | the CLONE_THREAD flag to the | |
42 | .BR clone (2) | |
43 | system call). All processes in the same thread group | |
44 | have the same PID, but each one has a unique TID. | |
45 | .SH "RETURN VALUE" | |
46 | On success, returns the thread ID of the current process. | |
47 | .SH ERRORS | |
48 | This call is always successful. | |
49 | .SH "CONFORMING TO" | |
50 | \fBgettid\fP is Linux specific and should not be used in programs that | |
51 | are intended to be portable. | |
52 | .SH "SEE ALSO" | |
53 | .BR clone (2), | |
54 | .BR fork (2), | |
55 | .BR getpid (2) |