OSDN Git Service

f6e8b2fa1c67620f2822f0eb12cd10bece6acfa7
[linuxjm/LDP_man-pages.git] / draft / man2 / tkill.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 2008 Michael Kerrisk <tmk.manpages@gmail.com>
4 .\" and Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" 2004-05-31, added tgkill, ahu, aeb
27 .\" 2008-01-15 mtk -- rewote DESCRIPTION
28 .\"
29 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
30 .\" Translated 2003-03-05, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
31 .\" Updated 2005-02-28, Akihiro MOTOKI
32 .\"
33 .TH TKILL 2 2011-09-18 "Linux" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .\"O tkill, tgkill \- send a signal to a thread
36 .SH 名前
37 tkill, tgkill \- スレッドにシグナルを送る
38 .\"O .SH SYNOPSIS
39 .SH 書式
40 .nf
41 .BI "int tkill(int " tid ", int " sig );
42 .sp
43 .BI "int tgkill(int " tgid ", int " tid ", int " sig );
44 .fi
45 .\"O .SH DESCRIPTION
46 .SH 説明
47 .\"O .BR tgkill ()
48 .\"O sends the signal
49 .\"O .I sig
50 .\"O to the thread with the thread ID
51 .\"O .I tid
52 .\"O in the thread group
53 .\"O .IR tgid .
54 .\"O (By contrast,
55 .\"O .BR kill (2)
56 .\"O can only be used to send a signal to a process (i.e., thread group)
57 .\"O as a whole, and the signal will be delivered to an arbitrary
58 .\"O thread within that process.)
59 .BR tgkill ()
60 はスレッド・グループ
61 .I tgid
62 に属するスレッド ID が
63 .I tid
64 のスレッドにシグナル
65 .I sig
66 を送る。
67 (これに対し、
68 .BR kill (2)
69 は一つのプロセス (すなわち、スレッド・グループ) にまとめてシグナルを
70 送るのにだけ利用できる。
71 .BR kill (2)
72 で送信されたシグナルはプロセス内の任意のスレッドに配送される。)
73
74 .\"O .BR tkill ()
75 .\"O is an obsolete predecessor to
76 .\"O .BR tgkill ().
77 .\"O It only allows the target thread ID to be specified,
78 .\"O which may result in the wrong thread being signaled if a thread
79 .\"O terminates and its thread ID is recycled.
80 .\"O Avoid using this system call.
81 .BR tkill ()
82 はもう使われなくなった
83 .BR tgkill ()
84 の先祖である。
85 .BR tkill ()
86 ではシグナルの送り先のスレッド ID しか指定できない。
87 そのため、スレッドが終了して、そのスレッド ID が再利用される場合に、
88 意図しないスレッドにシグナルが送られる可能性がある。
89 このシステムコールの使用は避けること。
90
91 .\"O If
92 .\"O .I tgid
93 .\"O is specified as \-1,
94 .\"O .BR tgkill ()
95 .\"O is equivalent to
96 .\"O .BR tkill ().
97 .I tgid
98 に \-1 が指定された場合、
99 .BR tgkill ()
100
101 .BR tkill ()
102 と等価である。
103
104 .\"O These are the raw system call interfaces, meant for internal
105 .\"O thread library use.
106 これらはシステムコールへの直接のインターフェースであり、
107 スレッド・ライブラリ内部での使用を意図したものである。
108 .\"O .SH "RETURN VALUE"
109 .SH 返り値
110 .\"O On success, zero is returned.
111 .\"O On error, \-1 is returned, and \fIerrno\fP
112 .\"O is set appropriately.
113 成功した場合、0 が返される。エラーが発生した場合、\-1 が返され、
114 \fIerrno\fP が適切に設定される。
115 .\"O .SH ERRORS
116 .SH エラー
117 .TP
118 .B EINVAL
119 .\"O An invalid thread ID, thread group ID, or signal was specified.
120 指定されたスレッド ID、スレッドグループ ID、シグナルが不正であった。
121 .TP
122 .B EPERM
123 .\"O Permission denied.
124 .\"O For the required permissions, see
125 .\"O .BR kill (2).
126 許可がなかった。どのような許可が必要かについては、
127 .BR kill (2)
128 を参照のこと。
129 .TP
130 .B ESRCH
131 .\"O No process with the specified thread ID (and thread group ID) exists.
132 指定されたスレッドID (とスレッド・グループID) を持つプロセスが存在しない。
133 .\"O .SH VERSIONS
134 .SH バージョン
135 .\"O .BR tkill ()
136 .\"O is supported since Linux 2.4.19 / 2.5.4.
137 .\"O .BR tgkill ()
138 .\"O was added in Linux 2.5.75.
139 .BR tkill ()
140 は Linux 2.4.19 / 2.5.4 以降でサポートされ、
141 .BR tgkill ()
142 は Linux 2.5.75 で追加された。
143 .\"O .SH "CONFORMING TO"
144 .SH 準拠
145 .\"O .BR tkill ()
146 .\"O and
147 .\"O .BR tgkill ()
148 .\"O are Linux-specific and should not be used
149 .\"O in programs that are intended to be portable.
150 .BR tkill ()
151
152 .BR tgkill ()
153 は Linux 固有であり、
154 移植を想定したプログラムでは使用すべきではない。
155 .\"O .SH NOTES
156 .SH 注意
157 .\"O See the description of
158 .\"O .B CLONE_THREAD
159 .\"O in
160 .\"O .BR clone (2)
161 .\"O for an explanation of thread groups.
162 スレッド・グループの説明については
163 .BR clone (2)
164
165 .B CLONE_THREAD
166 の説明を参照のこと。
167
168 .\"O Glibc does not provide wrappers for these system calls; call them using
169 .\"O .BR syscall (2).
170 glibc はこれらのシステムコールに対するラッパー関数を提供していない。
171 .BR syscall (2)
172 を使って呼び出すこと。
173 .\"O .SH "SEE ALSO"
174 .SH 関連項目
175 .BR clone (2),
176 .BR gettid (2),
177 .BR kill (2),
178 .BR rt_sigqueueinfo (2)