1 .\" Hey Emacs! This file is -*- nroff -*- source.
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" 2004-05-31, added tgkill, ahu, aeb
26 .TH TKILL 2 "2004-05-31" "Linux 2.6.6" "Linux Programmer's Manual"
28 tkill, tgkill \- send a signal to a single process
31 .B #include <sys/types.h>
33 .B #include <linux/unistd.h>
37 .B "_syscall2(int, tkill, int, tid, int, sig)"
39 .B int tkill(int tid, int sig);
41 .B "_syscall3(int, tgkill, int, tgid, int, tid, int, sig)"
43 .B int tgkill(int tgid, int tid, int sig);
46 The \fBtkill\fP() system call is analogous to
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
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
60 These are the raw system call interfaces, meant for internal
63 On success, zero is returned. On error, \-1 is returned, and \fIerrno\fP
68 An invalid TID or signal was specified.
71 Permission denied. For the required permissions, see
75 No process with the specified thread ID (and thread group ID) exists.
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.