1pthread_kill(3C) Standard C Library Functions pthread_kill(3C)
2
3
4
6 pthread_kill - send a signal to a thread
7
9 cc -mt [ flag... ] file... -lpthread [ library... ]
10 #include <signal.h>
11 #include <pthread.h>
12
13 int pthread_kill(pthread_t thread, int sig);
14
15
17 The pthread_kill() function sends the sig signal to the thread desig‐
18 nated by thread. The thread argument must be a member of the same
19 process as the calling thread. The sig argument must be one of the
20 signals listed in signal.h(3HEAD), with the exception of SIGCANCEL
21 being reserved and off limits to pthread_kill(). If sig is 0, a valid‐
22 ity check is performed for the existence of the target thread; no sig‐
23 nal is sent.
24
26 Upon successful completion, the function returns a value of 0. Other‐
27 wise the function returns an error number. If the pthread_kill() func‐
28 tion fails, no signal is sent.
29
31 The pthread_kill() function will fail if:
32
33 ESRCH No thread could be found corresponding to that specified by
34 the given thread ID.
35
36
37 EINVAL The value of the sig argument is an invalid or unsupported
38 signal number.
39
40
42 See attributes(5) for descriptions of the following attributes:
43
44
45
46
47 ┌─────────────────────────────┬─────────────────────────────┐
48 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
49 ├─────────────────────────────┼─────────────────────────────┤
50 │Interface Stability │Standard │
51 ├─────────────────────────────┼─────────────────────────────┤
52 │MT-Level │MT-Safe │
53 └─────────────────────────────┴─────────────────────────────┘
54
56 kill(1), pthread_self(3C), pthread_sigmask(3C), raise(3C),
57 attributes(5), standards(5)
58
59
60
61SunOS 5.11 23 Mar 2005 pthread_kill(3C)