OSDN Git Service

393f08cb6ca230548ebe843ad2febddd8318336d
[linuxjm/LDP_man-pages.git] / draft / man3 / sigset.3
1 '\" t
2 .\" Copyright (c) 2005 by Michael Kerrisk <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 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
25 .\" Translated 2005-12-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
26 .\"
27 .TH SIGSET 3 2010-09-20 "Linux" "Linux Programmer's Manual"
28 .\"O .SH NAME
29 .SH 名前
30 .\"O sigset, sighold, sigrelse, sigignore \- System V signal API
31 sigset, sighold, sigrelse, sigignore \- System V 版シグナル API
32 .\"O .SH SYNOPSIS
33 .SH 書式
34 .B #include <signal.h>
35 .sp
36 .B typedef void (*sighandler_t)(int);
37 .sp
38 .BI "sighandler_t sigset(int " sig ", sighandler_t " disp );
39 .sp
40 .BI "int sighold(int " sig );
41 .sp
42 .BI "int sigrelse(int " sig );
43 .sp
44 .BI "int sigignore(int " sig );
45 .sp
46 .in -4n
47 .\"O Feature Test Macro Requirements for glibc (see
48 .\"O .BR feature_test_macros (7)):
49 glibc 向けの機能検査マクロの要件
50 .RB ( feature_test_macros (7)
51 参照):
52 .in
53 .sp
54 .ad l
55 .BR sigset (),
56 .BR sighold (),
57 .BR sigrelse (),
58 .BR sigignore ():
59 .br
60 .RS 4
61 _XOPEN_SOURCE\ >=\ 500 ||
62 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
63 .RE
64 .ad
65 .\"O .SH DESCRIPTION
66 .SH 説明
67 .\"O These functions are provided in glibc as a compatibility interface
68 .\"O for programs that make use of the historical System V signal API.
69 .\"O This API is obsolete: new applications should use the POSIX signal API
70 .\"O .RB ( sigaction (2),
71 .\"O .BR sigprocmask (2),
72 .\"O etc.)
73 これらの関数は、昔ながらの System V 版シグナル API を使用しているプログラム
74 に対して互換性のあるインタフェースを glibc で提供するものである。
75 この API は過去のものであり、新しいアプリケーションでは
76 POSIX シグナル API
77 .RB ( sigaction (2),
78 .BR sigprocmask (2)
79 など) を使用すべきである。
80
81 .\"O The
82 .\"O .BR sigset ()
83 .\"O function modifies the disposition of the signal
84 .\"O .IR sig .
85 .\"O The
86 .\"O .I disp
87 .\"O argument can be the address of a signal handler function,
88 .\"O or one of the following constants:
89 関数
90 .BR sigset ()
91 はシグナル
92 .I sig
93 のシグナルハンドラの動作を変更する。
94 .I disp
95 引き数には、シグナルハンドラ関数のアドレスか、
96 以下の定数のいずれか一つを指定できる。
97 .TP
98 .B SIG_DFL
99 .\"O Reset the disposition of
100 .\"O .I sig
101 .\"O to the default.
102 .I sig
103 の動作をデフォルトにリセットする。
104 .TP
105 .B SIG_IGN
106 .\"O Ignore
107 .\"O .IR sig .
108 .I sig
109 を無視する。
110 .TP
111 .B SIG_HOLD
112 .\"O Add
113 .\"O .I sig
114 .\"O to the process's signal mask, but leave the disposition of
115 .\"O .I sig
116 .\"O unchanged.
117 そのプロセスのシグナルマスクに
118 .I sig
119 を追加するが、
120 .I sig
121 の動作は変更しない。
122 .PP
123 .\"O If
124 .\"O .I disp
125 .\"O specifies the address of a signal handler, then
126 .\"O .I sig
127 .\"O is added to the process's signal mask during execution of the handler.
128 .I disp
129 にシグナルハンドラのアドレスが指定された場合、
130 シグナルハンドラの実行中は、そのプロセスのシグナルマスクに
131 .I sig
132 が追加される。
133 .PP
134 .\"O If
135 .\"O .I disp
136 .\"O was specified as a value other than
137 .\"O .BR SIG_HOLD ,
138 .\"O then
139 .\"O .I sig
140 .\"O is removed from the process's signal mask.
141 .I disp
142
143 .B SIG_HOLD
144 以外の値が指定された場合、
145 そのプロセスのシグナルマスクから
146 .I sig
147 が削除される。
148 .PP
149 .\"O The dispositions for
150 .\"O .B SIGKILL
151 .\"O and
152 .\"O .B SIGSTOP
153 .\"O cannot be changed.
154 シグナル
155 .B SIGKILL
156
157 .B SIGSTOP
158 に対する動作は変更できない。
159 .PP
160 .\"O The
161 .\"O .BR sighold ()
162 .\"O function adds
163 .\"O .I sig
164 .\"O to the calling process's signal mask.
165 関数
166 .BR sighold ()
167 は、呼び出し元プロセスのシグナルマスクに
168 .I sig
169 を追加する。
170
171 .\"O The
172 .\"O .BR sigrelse ()
173 .\"O function removes
174 .\"O .I sig
175 .\"O from the calling process's signal mask.
176 関数
177 .BR sigrelse ()
178 は、呼び出し元プロセスのシグナルマスクから
179 .I sig
180 を削除する。
181
182 .\"O The
183 .\"O .BR sigignore ()
184 .\"O function sets the disposition of
185 .\"O .I sig
186 .\"O to
187 .\"O .BR SIG_IGN .
188 関数
189 .BR sigignore ()
190 は、
191 .I sig
192 の動作を
193 .B SIG_IGN
194 に設定する。
195 .\"O .SH RETURN VALUE
196 .SH 返り値
197 .\"O On success,
198 .\"O .BR sigset ()
199 .\"O returns
200 .\"O .B SIG_HOLD
201 .\"O if
202 .\"O .I sig
203 .\"O was blocked before the call,
204 .\"O or the signal's previous disposition
205 .\"O if it was not blocked before the call.
206 .BR sigset ()
207 は成功すると、
208 呼び出し前に
209 .I sig
210 がブロックされていた場合には
211 .B SIG_HOLD
212 を返し、
213 ブロックされていなかった場合には
214 変更前のそのシグナルの動作を返す。
215 .\"O On error,
216 .\"O .BR sigset ()
217 .\"O returns \-1, with
218 .\"O .I errno
219 .\"O set to indicate the error.
220 エラーの場合、
221 .BR sigset ()
222 は \-1 を返し、
223 .I errno
224 にエラーを示す値をセットする。
225 .\"O (But see BUGS below.)
226 但し、以下の「バグ」の節も参照のこと。
227
228 .\"O The
229 .\"O .BR sighold (),
230 .\"O .BR sigrelse (),
231 .\"O and
232 .\"O .BR sigignore ()
233 .\"O functions return 0 on success; on error, these functions return \-1 and set
234 .\"O .I errno
235 .\"O to indicate the error.
236 関数
237 .BR sighold (),
238 .BR sigrelse (),
239 .BR sigignore ()
240 は成功すると 0 を返す。エラーの場合、\-1 を返し、
241 .I errno
242 にエラーを示す値をセットする。
243 .\"O .SH ERRORS
244 .SH エラー
245 .\"O For
246 .\"O .BR sigset ()
247 .\"O see the ERRORS under
248 .\"O .BR sigaction (2)
249 .\"O and
250 .\"O .BR sigprocmask (2).
251 .BR sigset ()
252 に関しては、
253 .BR sigaction (2)
254
255 .BR sigprocmask (2)
256 の「エラー」の節を参照。
257
258 .\"O For
259 .\"O .BR sighold ()
260 .\"O and
261 .\"O .BR sigrelse ()
262 .\"O see the ERRORS under
263 .\"O .BR sigprocmask (2).
264 .BR sighold ()
265
266 .BR sigrelse ()
267 に関しては、
268 .BR sigprocmask (2)
269 の「エラー」の節を参照。
270
271 .\"O For
272 .\"O .BR sigignore (),
273 .\"O see the errors under
274 .\"O .BR sigaction (2).
275 .BR sigignore ()
276 に関しては、
277 .BR sigaction (2)
278 の「エラー」の節を参照。
279 .\"O .SH "CONFORMING TO"
280 .SH 準拠
281 SVr4, POSIX.1-2001.
282 .\"O These functions are obsolete: do not use them in new programs.
283 これらの関数は廃止予定である。新しいプログラムでは使用しないこと。
284 .\"O POSIX.1-2008 marks
285 .\"O .BR sighold (),
286 .\"O .BR sigignore (),
287 .\"O .BR sigpause (),
288 .\"O .BR sigrelse (),
289 .\"O and
290 .\"O .BR sigset ()
291 .\"O as obsolete, recommending the use of
292 .\"O .BR sigaction (2),
293 .\"O .BR sigprocmask (2),
294 .\"O .BR pthread_sigmask (3),
295 .\"O and
296 .\"O .BR sigsuspend (2)
297 .\"O instead.
298 POSIX.1-2008 は、
299 .BR sighold (),
300 .BR sigignore (),
301 .BR sigpause (),
302 .BR sigrelse (),
303 .BR sigset ()
304 を廃止予定としている。
305 代わりに、
306 .BR sigaction (2),
307 .BR sigprocmask (2),
308 .BR pthread_sigmask (3),
309 .BR sigsuspend (2)
310 の使用が推奨されている。
311 .\"O .SH NOTES
312 .SH 注意
313 .\"O These functions appeared in glibc version 2.1.
314 これらの関数は glibc 2.1 で登場した。
315
316 .\"O The
317 .\"O .I sighandler_t
318 .\"O type is a GNU extension; it is only used on this page to make the
319 .\"O .BR sigset ()
320 .\"O prototype more easily readable.
321 .I sighandler_t
322 型は GNU による拡張であり、この man page で
323 .BR sigset ()
324 のプロトタイプをより読みやすくするために使われているだけである。
325
326 .\"O The
327 .\"O .BR sigset ()
328 .\"O function provides reliable signal handling semantics (as when calling
329 .\"O .BR sigaction (2)
330 .\"O with
331 .\"O .I sa_mask
332 .\"O equal to 0).
333 関数
334 .BR sigset ()
335 は信頼性のあるシグナル処理機構を提供する
336 .RI ( sa_mask
337 を 0 で
338 .BR sigaction (2)
339 を呼び出したときと同様)。
340
341 .\"O On System V, the
342 .\"O .BR signal ()
343 .\"O function provides unreliable semantics (as when calling
344 .\"O .BR sigaction (2)
345 .\"O with
346 .\"O .I sa_mask
347 .\"O equal to
348 .\"O .IR "SA_RESETHAND | SA_NODEFER" ).
349 System V では、関数
350 .BR signal ()
351 が提供する処理機構は信頼性のないものである
352 .RI ( sa_mask
353
354 .IR "SA_RESETHAND | SA_NODEFER"
355 として
356 .BR sigaction (2)
357 を呼び出したときと同様)。
358 .\"O On BSD,
359 .\"O .BR signal ()
360 .\"O provides reliable semantics.
361 BSD では、
362 .BR signal ()
363 は信頼性のある処理機構を提供する。
364 .\"O POSIX.1-2001 leaves these aspects of
365 .\"O .BR signal ()
366 .\"O unspecified.
367 POSIX.1-2001 では、
368 .BR signal ()
369 のこの点は規定しないままとなっている。
370 .\"O See
371 .\"O .BR signal (2)
372 .\"O for further details.
373 さらなる詳細については
374 .BR signal (2)
375 を参照。
376
377 .\"O In order to wait for a signal,
378 .\"O BSD and System V both provided a function named
379 .\"O .BR sigpause (3),
380 .\"O but this function has a different argument on the two systems.
381 .\"O See
382 .\"O .BR sigpause (3)
383 .\"O for details.
384 BSD と System V のどちらのシステムでも
385 シグナルを待つために、
386 .BR sigpause (3)
387 という名前の関数が提供されているが、
388 この関数の引き数は両方のシステムで異なる。
389 詳細は
390 .BR sigpause (3)
391 を参照。
392 .\"O .SH BUGS
393 .SH バグ
394 .\"O In versions of glibc before 2.2,
395 .\"O .BR sigset ()
396 .\"O did not unblock
397 .\"O .I sig
398 .\"O if
399 .\"O .I disp
400 .\"O was specified as a value other than
401 .\"O .BR SIG_HOLD .
402 2.2 より前のバージョンの glibc では、
403 .I disp
404
405 .B SIG_HOLD
406 以外の値が指定された場合、
407 .I sig
408 のブロック解除を行っていなかった。
409
410 .\"O In all versions of glibc up to and including 2.3.5,
411 .\"O .BR sigset ()
412 .\"O does not correctly return the previous disposition of the signal
413 .\"O in two cases.
414 2.3.5 以前の全てのバージョンの glibc では、
415 .BR sigset ()
416 が変更前のシグナルの動作を正しく返さない場合が 2つある。
417 .\"O First, if
418 .\"O .I disp
419 .\"O is specified as
420 .\"O .BR SIG_HOLD ,
421 .\"O then a successful
422 .\"O .BR sigset ()
423 .\"O always returns
424 .\"O .BR SIG_HOLD .
425 .\"O Instead, it should return the previous disposition of the signal
426 .\"O (unless the signal was blocked, in which case
427 .\"O .B SIG_HOLD
428 .\"O should be returned).
429 一つめは、
430 .I disp
431
432 .B SIG_HOLD
433 が指定されると、成功した場合
434 .BR sigset ()
435 は常に
436 .B SIG_HOLD
437 を返すことである。
438 正しくは、(シグナルがブロックされていなかった場合には)
439 変更前のシグナルの動作を返すべきである
440 (シグナルがブロックされていた場合には、
441 .B SIG_HOLD
442 が返される)。
443 .\"O Second, if the signal is currently blocked, then
444 .\"O the return value of a successful
445 .\"O .BR sigset ()
446 .\"O should be
447 .\"O .BR SIG_HOLD .
448 .\"O Instead, the previous disposition of the signal is returned.
449 もう一つは、シグナルが現在ブロックされている場合には、
450 成功した場合の
451 .BR sigset ()
452 の返り値は
453 .B SIG_HOLD
454 になるべきであるが、実際には
455 変更前のシグナルの動作が返されることである。
456 .\"O These problems have been fixed since glibc 2.5.
457 これらの問題は glibc 2.5 以降で修正されている。
458 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
459 .\"O .SH "SEE ALSO"
460 .SH 関連項目
461 .BR kill (2),
462 .BR pause (2),
463 .BR sigaction (2),
464 .BR signal (2),
465 .BR sigprocmask (2),
466 .BR raise (3),
467 .BR sigpause (3),
468 .BR sigvec (3),
469 .BR signal (7)