1PTHREAD_KILL(3P) POSIX Programmer's Manual PTHREAD_KILL(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 pthread_kill - send a signal to a thread
13
15 #include <signal.h>
16
17 int pthread_kill(pthread_t thread, int sig);
18
19
21 The pthread_kill() function shall request that a signal be delivered to
22 the specified thread.
23
24 As in kill(), if sig is zero, error checking shall be performed but no
25 signal shall actually be sent.
26
28 Upon successful completion, the function shall return a value of zero.
29 Otherwise, the function shall return an error number. If the
30 pthread_kill() function fails, no signal shall be sent.
31
33 The pthread_kill() function shall fail if:
34
35 ESRCH No thread could be found corresponding to that specified by the
36 given thread ID.
37
38 EINVAL The value of the sig argument is an invalid or unsupported sig‐
39 nal number.
40
41
42 The pthread_kill() function shall not return an error code of [EINTR].
43
44 The following sections are informative.
45
47 None.
48
50 The pthread_kill() function provides a mechanism for asynchronously
51 directing a signal at a thread in the calling process. This could be
52 used, for example, by one thread to affect broadcast delivery of a sig‐
53 nal to a set of threads.
54
55 Note that pthread_kill() only causes the signal to be handled in the
56 context of the given thread; the signal action (termination or stop‐
57 ping) affects the process as a whole.
58
60 None.
61
63 None.
64
66 kill(), pthread_self(), raise(), the Base Definitions volume of
67 IEEE Std 1003.1-2001, <signal.h>
68
70 Portions of this text are reprinted and reproduced in electronic form
71 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
72 -- Portable Operating System Interface (POSIX), The Open Group Base
73 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
74 Electrical and Electronics Engineers, Inc and The Open Group. In the
75 event of any discrepancy between this version and the original IEEE and
76 The Open Group Standard, the original IEEE and The Open Group Standard
77 is the referee document. The original Standard can be obtained online
78 at http://www.opengroup.org/unix/online.html .
79
80
81
82IEEE/The Open Group 2003 PTHREAD_KILL(3P)