1 .\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
2 .\" All rights reserved.
4 .\" This documentation was written by
5 .\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
6 .\" from the FreeBSD Foundation.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .Nd send signal to thread
42 .Fn thr_kill "long id" "int sig"
44 .Fn thr_kill2 "pid_t pid" "long id" "int sig"
50 system calls allow sending a signal, specified by the
52 argument, to some threads in a process.
55 function, signalled threads are always limited to the current process.
60 argument specifies the process with threads to be signalled.
64 argument specifies which threads get the signal.
67 is equal to \-1, all threads in the specified process are signalled.
68 Otherwise, only the thread with the thread identifier equal to the
69 argument is signalled.
73 argument defines the delivered signal.
74 It must be a valid signal number or zero.
75 In the latter case no signal is actually sent, and the call is used to
76 verify the liveness of the thread.
78 The signal is delivered with
88 will return zero, otherwise \-1 is returned, and
90 is set to indicate the error.
96 operations return the following errors:
101 argument is not zero and does not specify valid signal.
103 The specified process or thread was not found.
108 may return the following errors:
111 The current process does not have sufficient privilege to check existence or
112 send a signal to the specified process.
128 system calls are non-standard and are used by the
139 system calls first appeared in