]>
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. | |
c13182ef | 12 | .\" |
fea681da MK |
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. | |
c13182ef | 20 | .\" |
fea681da MK |
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 | .\" 2004-05-31, added tgkill, ahu, aeb | |
25 | .\" | |
3d5a3539 | 26 | .TH TKILL 2 2004-05-31 "Linux 2.6.6" "Linux Programmer's Manual" |
fea681da MK |
27 | .SH NAME |
28 | tkill, tgkill \- send a signal to a single process | |
29 | .SH SYNOPSIS | |
30 | .nf | |
31 | .B #include <sys/types.h> | |
32 | .br | |
33 | .B #include <linux/unistd.h> | |
527d9933 MK |
34 | .br |
35 | .B #include <errno.h> | |
fea681da MK |
36 | .sp |
37 | .B "_syscall2(int, tkill, int, tid, int, sig)" | |
16718a1c | 38 | /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ |
fea681da MK |
39 | .sp |
40 | .B int tkill(int tid, int sig); | |
41 | .sp | |
527d9933 | 42 | .B "_syscall3(int, tgkill, int, tgid, int, tid, int, sig)" |
16718a1c | 43 | /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ |
fea681da MK |
44 | .sp |
45 | .B int tgkill(int tgid, int tid, int sig); | |
46 | .fi | |
47 | .SH DESCRIPTION | |
60a90ecd MK |
48 | The |
49 | .BR tkill () | |
50 | system call is analogous to | |
fea681da MK |
51 | .BR kill (2), |
52 | except when the specified process is part of a thread group | |
53 | (created by specifying the CLONE_THREAD flag in the call to clone). | |
54 | Since all the processes in a thread group have the same PID, | |
60a90ecd MK |
55 | they cannot be individually signalled with |
56 | .BR kill (2). | |
57 | With | |
58 | .BR tkill (), | |
59 | however, one can address each process | |
fea681da MK |
60 | by its unique TID. |
61 | .PP | |
60a90ecd MK |
62 | The |
63 | .BR tgkill () | |
64 | call improves on | |
65 | .BR tkill () | |
66 | by allowing the caller to | |
fea681da | 67 | specify the thread group ID of the thread to be signalled, protecting |
c13182ef | 68 | against TID reuse. |
60a90ecd MK |
69 | If the tgid is specified as \-1, |
70 | .BR tgkill () | |
71 | degenerates | |
72 | into | |
73 | .BR tkill (). | |
fea681da MK |
74 | .PP |
75 | These are the raw system call interfaces, meant for internal | |
76 | thread library use. | |
77 | .SH "RETURN VALUE" | |
c13182ef MK |
78 | On success, zero is returned. |
79 | On error, \-1 is returned, and \fIerrno\fP | |
fea681da MK |
80 | is set appropriately. |
81 | .SH ERRORS | |
82 | .TP | |
83 | .B EINVAL | |
84 | An invalid TID or signal was specified. | |
85 | .TP | |
86 | .B EPERM | |
c13182ef MK |
87 | Permission denied. |
88 | For the required permissions, see | |
fea681da MK |
89 | .BR kill (2). |
90 | .TP | |
91 | .B ESRCH | |
92 | No process with the specified thread ID (and thread group ID) exists. | |
2dd578fd MK |
93 | .SH VERSIONS |
94 | .BR tkill () | |
95 | is supported since Linux 2.4.19 / 2.5.4. | |
96 | .BR tgkill () | |
97 | was added in Linux 2.5.75. | |
fea681da | 98 | .SH "CONFORMING TO" |
60a90ecd MK |
99 | .BR tkill () |
100 | and | |
101 | .BR tgkill () | |
102 | are Linux specific and should not be used | |
fea681da | 103 | in programs that are intended to be portable. |
fea681da MK |
104 | .SH "SEE ALSO" |
105 | .BR gettid (2), | |
106 | .BR kill (2) |