OSDN Git Service

(split) LDP man-pages の original/ を v3.30 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / pthread_kill.3
1 .\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
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 .TH PTHREAD_KILL 3 2009-01-28 "Linux" "Linux Programmer's Manual"
25 .SH NAME
26 pthread_kill \- send a signal to a thread
27 .SH SYNOPSIS
28 .nf
29 .B #include <signal.h>
30
31 .BI "int pthread_kill(pthread_t " thread ", int " sig );
32 .fi
33 .sp
34 Compile and link with \fI\-pthread\fP.
35 .SH DESCRIPTION
36 The
37 .BR pthread_kill ()
38 function sends the signal
39 .I sig
40 to
41 .IR thread ,
42 another thread in the same process as the caller.
43 The signal is asynchronously directed to
44 .IR thread .
45
46 If
47 .I sig
48 is 0, then no signal is sent, but error checking is still performed;
49 this can be used to check for the existence of a thread ID.
50 .SH RETURN VALUE
51 On success,
52 .BR pthread_kill ()
53 returns 0;
54 on error, it returns an error number, and no signal is sent.
55 .SH ERRORS
56 .TP
57 .B EINVAL
58 An invalid signal was specified.
59 .TP
60 .B ESRCH
61 No thread with the ID
62 .I thread
63 could be found.
64 .SH CONFORMING TO
65 POSIX.1-2001.
66 .SH NOTES
67 Signal dispositions are process-wide:
68 if a signal handler is installed,
69 the handler will be invoked in the thread
70 .IR thread ,
71 but if the disposition of the signal is "stop", "continue", or "terminate",
72 this action will affect the whole process.
73 .SH SEE ALSO
74 .BR kill (2)
75 .BR sigaction (2),
76 .BR sigpending (2),
77 .BR pthread_self (3),
78 .BR pthread_sigmask (3),
79 .BR raise (3),
80 .BR pthreads (7),
81 .BR signal (7)