]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/tkill.2
Manual fixes of parentheses formatting
[thirdparty/man-pages.git] / man2 / tkill.2
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 .\" 2004-05-31, added tgkill, ahu, aeb
25 .\"
26 .TH TKILL 2 "2004-05-31" "Linux 2.6.6" "Linux Programmer's Manual"
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>
34 .br
35 .B #include <errno.h>
36 .sp
37 .B "_syscall2(int, tkill, int, tid, int, sig)"
38 .sp
39 .B int tkill(int tid, int sig);
40 .sp
41 .B "_syscall3(int, tgkill, int, tgid, int, tid, int, sig)"
42 .sp
43 .B int tgkill(int tgid, int tid, int sig);
44 .fi
45 .SH DESCRIPTION
46 The \fBtkill\fP() system call is analogous to
47 .BR kill (2),
48 except when the specified process is part of a thread group
49 (created by specifying the CLONE_THREAD flag in the call to clone).
50 Since all the processes in a thread group have the same PID,
51 they cannot be individually signalled with \fBkill\fP().
52 With \fBtkill\fP(), however, one can address each process
53 by its unique TID.
54 .PP
55 The \fBtgkill\fP() call improves on \fBtkill\fP() by allowing the caller to
56 specify the thread group ID of the thread to be signalled, protecting
57 against TID reuse. If the tgid is specified as \-1, \fBtgkill\fP() degenerates
58 into \fBtkill\fP().
59 .PP
60 These are the raw system call interfaces, meant for internal
61 thread library use.
62 .SH "RETURN VALUE"
63 On success, zero is returned. On error, \-1 is returned, and \fIerrno\fP
64 is set appropriately.
65 .SH ERRORS
66 .TP
67 .B EINVAL
68 An invalid TID or signal was specified.
69 .TP
70 .B EPERM
71 Permission denied. For the required permissions, see
72 .BR kill (2).
73 .TP
74 .B ESRCH
75 No process with the specified thread ID (and thread group ID) exists.
76 .SH "CONFORMING TO"
77 \fBtkill\fP() and \fBtgkill\fP() are Linux specific and should not be used
78 in programs that are intended to be portable.
79 \fBtkill\fP() is supported since Linux 2.4.19 / 2.5.4.
80 \fBtgkill\fP() was added in Linux 2.5.75.
81 .SH "SEE ALSO"
82 .BR gettid (2),
83 .BR kill (2)