OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man3 / sigqueue.3
1 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" added note on self-signaling, aeb, 2002-06-07
24 .\" added note on CAP_KILL, mtk, 2004-06-16
25 .\"
26 .\" Japanese Version Copyright (c) 2002, 2005 Yuichi SATO
27 .\"         all rights reserved.
28 .\" Translated 2002-08-06, Yuichi SATO <ysato@h4.dion.ne.jp>
29 .\" Updated & Modified 2005-01-08, Yuichi SATO <ysato444@yahoo.co.jp>
30 .\" Updated 2007-09-08, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
31 .\"
32 .TH SIGQUEUE 3 2011-09-18 "Linux" "Linux Programmer's Manual"
33 .\"O .SH NAME
34 .SH 名前
35 .\"O sigqueue, rt_sigqueueinfo \- queue a signal and data to a process
36 sigqueue, rt_sigqueueinfo \- シグナルとデータをプロセスに送る
37 .\"O .SH SYNOPSIS
38 .SH 書式
39 .B #include <signal.h>
40 .sp
41 .BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
42 .sp
43 .in -4n
44 .\"O Feature Test Macro Requirements for glibc (see
45 .\"O .BR feature_test_macros (7)):
46 glibc 向けの機能検査マクロの要件
47 .RB ( feature_test_macros (7)
48 参照):
49 .in
50 .sp
51 .BR sigqueue ():
52 _POSIX_C_SOURCE\ >=\ 199309L
53 .\"O .SH DESCRIPTION
54 .SH 説明
55 .\"O .BR sigqueue ()
56 .\"O sends the signal specified in
57 .\"O .I sig
58 .\"O to the process whose PID is given in
59 .\"O .IR pid .
60 .BR sigqueue ()
61
62 .I sig
63 で指定されたシグナルを、PID が
64 .I pid
65 であるプロセスに送る。
66 .\"O The permissions required to send a signal are the same as for
67 .\"O .BR kill (2).
68 シグナルを送るのに必要な権限は
69 .BR kill (2)
70 と同じである。
71 .\"O As with
72 .\"O .BR kill (2),
73 .\"O the null signal (0) can be used to check if a process with a given
74 .\"O PID exists.
75 .BR kill (2)
76 と同様に、ヌル・シグナル (0) を使って
77 指定した PID のプロセスが存在するかをチェックすることができる。
78 .PP
79 .\"O The
80 .\"O .I value
81 .\"O argument is used to specify an accompanying item of data (either an integer
82 .\"O or a pointer value) to be sent with the signal, and has the following type:
83 .I value
84 引き数はシグナルと一緒に送るデータの付属アイテムを指定する。
85 .I value
86 は (整数またはポインタの値であり) 以下のような型である。
87 .sp
88 .in +4n
89 .nf
90 union sigval {
91     int   sival_int;
92     void *sival_ptr;
93 };
94 .fi
95 .in
96
97 .\"O If the receiving process has installed a handler for this signal using the
98 .\"O .B SA_SIGINFO
99 .\"O flag to
100 .\"O .BR sigaction (2),
101 .\"O then it can obtain this data via the
102 .\"O .I si_value
103 .\"O field of the
104 .\"O .I siginfo_t
105 .\"O structure passed as the second argument to the handler.
106 受取先のプロセスに、このシグナルに対するハンドラを
107 .RB ( sigaction (2)
108
109 .B SA_SIGINFO
110 を指定して) インストールしておくと、
111 そのハンドラの第 2 引き数に渡される
112 .I siginfo_t
113 構造体の
114 .I si_value
115 フィールドによって、このデータを取得できる。
116 .\"O Furthermore, the
117 .\"O .I si_code
118 .\"O field of that structure will be set to
119 .\"O .BR SI_QUEUE .
120 さらに、この構造体の
121 .I si_code
122 フィールドは
123 .B SI_QUEUE
124 に設定される。
125 .\"O .SH "RETURN VALUE"
126 .SH 返り値
127 .\"O On success,
128 .\"O .BR sigqueue ()
129 .\"O returns 0, indicating that the signal was successfully
130 .\"O queued to the receiving process.
131 成功した場合、
132 .BR sigqueue ()
133 は 0 を返す。
134 これは受け取り側プロセスの待ち行列に
135 シグナルが正しく入れられたことを示す。
136 .\"O Otherwise \-1 is returned and
137 .\"O .I errno
138 .\"O is set to indicate the error.
139 失敗した場合は \-1 が返され、
140 .I errno
141 がエラーを表す値に設定される。
142 .\"O .SH ERRORS
143 .SH エラー
144 .TP
145 .B EAGAIN
146 .\"O The limit of signals which may be queued has been reached.
147 待ち行列に入れられるシグナルの最大数に達した
148 .\"O (See
149 .\"O .BR signal (7)
150 .\"O for further information.)
151 (より詳しい情報は
152 .BR signal (7)
153 を参照すること)。
154 .TP
155 .B EINVAL
156 .\"O .I sig
157 .\"O was invalid.
158 .I sig
159 が不正である。
160 .TP
161 .B EPERM
162 .\"O The process does not have permission to send the signal
163 .\"O to the receiving process.
164 このプロセスには、受け取り側プロセスにシグナルを送る権限がない。
165 .\"O For the required permissions, see
166 .\"O .BR kill (2).
167 必要な権限については、
168 .BR kill (2)
169 を参照すること。
170 .TP
171 .B ESRCH
172 .\"O No process has a PID matching
173 .\"O .IR pid .
174 .I pid
175 にマッチする PID のプロセスがない。
176 .\"O .SH VERSIONS
177 .SH バージョン
178 .\"O This system call first appeared in Linux 2.2.
179 このシステムコールは Linux 2.2 で初めて登場した。
180 .\"O .SH "CONFORMING TO"
181 .SH 準拠
182 POSIX.1-2001.
183 .\"O .SH NOTES
184 .SH 注意
185 .\"O If this function results in the sending of a signal to the process
186 .\"O that invoked it, and that signal was not blocked by the calling thread,
187 .\"O and no other threads were willing to handle this signal (either by
188 .\"O having it unblocked, or by waiting for it using
189 .\"O .BR sigwait (3)),
190 .\"O then at least some signal must be delivered to this thread before this
191 .\"O function returns.
192 .\"Osato:
193 .\"Osato: この文章は長すぎるのと it が多すぎるために良く分かりません。
194 .\"Osato: that invoked it ( = this function)
195 .\"Osato: by having it ( = that signal) unblocked
196 .\"Osato: by waiting for it  ( = that signal) using sigwait(3)
197 .\"Osato: として訳してみました。
198 .\"Osato: 詳しい方からの御指摘をお待ちします。
199 .\"Osato:
200 この関数を呼び出したプロセスにこの関数がシグナルを送ったときに、
201 シグナルが呼び出し側スレッドにブロックされず、
202 かつ (シグナルがブロックされなかった、または
203 .BR sigwait (3)
204 を使用するのを待っていることにより)
205 このシグナルを扱うスレッドが何もない場合は、
206 この関数がリターンする前に、少なくとも
207 そのスレッドに対してシグナルが配送されていなければならない。
208
209 .\"O On Linux, this function is implemented using the
210 .\"O .BR rt_sigqueueinfo (2)
211 .\"O system call.
212 .\"O The system call differs in its third argument, which is the
213 .\"O .I siginfo_t
214 .\"O structure that will be supplied to the receiving process's
215 .\"O signal handler or returned by the receiving process's
216 .\"O .BR sigtimedwait (2)
217 .\"O call.
218 .\"O Inside the glibc
219 .\"O .BR sigqueue ()
220 .\"O wrapper, this argument,
221 .\"O .IR uinfo ,
222 .\"O is initialized as follows:
223 Linux では、この関数は
224 .BR rt_sigqueueinfo (2)
225 システムコールを使って実装されている。
226 両者には 3 番目の引き数に違いがあり、
227 .BR rt_sigqueueinfo (2)
228 では 3 番目の引き数は
229 .I siginfo_t
230 構造体である。
231 .I siginfo_t
232 構造体は、シグナルを受信するプロセスのシグナルハンドラに渡されたり、
233 シグナル受信プロセスの
234 .BR sigtimedwait (2)
235 システムコールから返されたりする。
236 glibc の
237 .BR sigqueue ()
238 ラッパー関数内部では、
239 この引き数
240 .I uinfo
241 は以下のように初期化される。
242 .in +4n
243 .nf
244
245 uinfo.si_signo = sig;      /* argument supplied to sigqueue() */
246 uinfo.si_code = SI_QUEUE;
247 uinfo.si_pid = getpid();   /* Process ID of sender */
248 uinfo.si_uid = getuid();   /* Real UID of sender */
249 uinfo.si_value = val;      /* argument supplied to sigqueue() */
250 .fi
251 .in
252 .\"O .SH "SEE ALSO"
253 .SH 関連項目
254 .BR kill (2),
255 .BR rt_sigqueueinfo (2),
256 .BR sigaction (2),
257 .BR signal (2),
258 .BR pthread_sigqueue (3),
259 .BR sigwait (3),
260 .BR signal (7)