OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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 2009-03-15 "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 #define _XOPEN_SOURCE 500
35 .br
36 .B #include <signal.h>
37 .sp
38 .B typedef void (*sighandler_t)(int);
39 .sp
40 .BI "sighandler_t sigset(int " sig ", sighandler_t " disp );
41 .sp
42 .BI "int sighold(int " sig );
43 .sp
44 .BI "int sigrelse(int " sig );
45 .sp
46 .BI "int sigignore(int " sig );
47 .\"O .SH DESCRIPTION
48 .SH ÀâÌÀ
49 .\"O These functions are provided in glibc as a compatibility interface
50 .\"O for programs that make use of the historical System V signal API.
51 .\"O This API is obsolete: new applications should use the POSIX signal API
52 .\"O .RB ( sigaction (2),
53 .\"O .BR sigprocmask (2),
54 .\"O etc.)
55 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î System V ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à
56 ¤ËÂФ·¤Æ¸ß´¹À­¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
57 ¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï
58 POSIX ¥·¥°¥Ê¥ë API
59 .RB ( sigaction (2),
60 .BR sigprocmask (2)
61 ¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£
62
63 .\"O The
64 .\"O .BR sigset ()
65 .\"O function modifies the disposition of the signal
66 .\"O .IR sig .
67 .\"O The
68 .\"O .I disp
69 .\"O argument can be the address of a signal handler function,
70 .\"O or one of the following constants:
71 ´Ø¿ô
72 .BR sigset ()
73 ¤Ï¥·¥°¥Ê¥ë
74 .I sig
75 ¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£
76 .I disp
77 °ú¤­¿ô¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢
78 °Ê²¼¤ÎÄê¿ô¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£
79 .TP
80 .B SIG_DFL
81 .\"O Reset the disposition of
82 .\"O .I sig
83 .\"O to the default.
84 .I sig
85 ¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£
86 .TP
87 .B SIG_IGN
88 .\"O Ignore
89 .\"O .IR sig .
90 .I sig
91 ¤ò̵»ë¤¹¤ë¡£
92 .TP
93 .B SIG_HOLD
94 .\"O Add
95 .\"O .I sig
96 .\"O to the process's signal mask, but leave the disposition of
97 .\"O .I sig
98 .\"O unchanged.
99 ¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
100 .I sig
101 ¤òÄɲ乤뤬¡¢
102 .I sig
103 ¤ÎÆ°ºî¤ÏÊѹ¹¤·¤Ê¤¤¡£
104 .PP
105 .\"O If
106 .\"O .I disp
107 .\"O specifies the address of a signal handler, then
108 .\"O .I sig
109 .\"O is added to the process's signal mask during execution of the handler.
110 .I disp
111 ¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
112 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
113 .I sig
114 ¤¬Äɲ䵤ì¤ë¡£
115 .PP
116 .\"O If
117 .\"O .I disp
118 .\"O was specified as a value other than
119 .\"O .BR SIG_HOLD ,
120 .\"O then
121 .\"O .I sig
122 .\"O is removed from the process's signal mask.
123 .I disp
124 ¤Ë
125 .B SIG_HOLD
126 °Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
127 ¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é
128 .I sig
129 ¤¬ºï½ü¤µ¤ì¤ë¡£
130 .PP
131 .\"O The dispositions for
132 .\"O .B SIGKILL
133 .\"O and
134 .\"O .B SIGSTOP
135 .\"O cannot be changed.
136 ¥·¥°¥Ê¥ë
137 .B SIGKILL
138 ¤È
139 .B SIGSTOP
140 ¤ËÂФ¹¤ëÆ°ºî¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¡£
141 .PP
142 .\"O The
143 .\"O .BR sighold ()
144 .\"O function adds
145 .\"O .I sig
146 .\"O to the calling process's signal mask.
147 ´Ø¿ô
148 .BR sighold ()
149 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
150 .I sig
151 ¤òÄɲ乤롣
152
153 .\"O The
154 .\"O .BR sigrelse ()
155 .\"O function removes
156 .\"O .I sig
157 .\"O from the calling process's signal mask.
158 ´Ø¿ô
159 .BR sigrelse ()
160 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é
161 .I sig
162 ¤òºï½ü¤¹¤ë¡£
163
164 .\"O The
165 .\"O .BR sigignore ()
166 .\"O function sets the disposition of
167 .\"O .I sig
168 .\"O to
169 .\"O .BR SIG_IGN .
170 ´Ø¿ô
171 .BR sigignore ()
172 ¤Ï¡¢
173 .I sig
174 ¤ÎÆ°ºî¤ò
175 .B SIG_IGN
176 ¤ËÀßÄꤹ¤ë¡£
177 .\"O .SH RETURN VALUE
178 .SH ÊÖ¤êÃÍ
179 .\"O On success,
180 .\"O .BR sigset ()
181 .\"O returns
182 .\"O .B SIG_HOLD
183 .\"O if
184 .\"O .I sig
185 .\"O was blocked before the call,
186 .\"O or the signal's previous disposition
187 .\"O if it was not blocked before the call.
188 .BR sigset ()
189 ¤ÏÀ®¸ù¤¹¤ë¤È¡¢
190 ¸Æ¤Ó½Ð¤·Á°¤Ë
191 .I sig
192 ¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï
193 .B SIG_HOLD
194 ¤òÊÖ¤·¡¢
195 ¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï
196 Êѹ¹Á°¤Î¤½¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¡£
197 .\"O On error,
198 .\"O .BR sigset ()
199 .\"O returns \-1, with
200 .\"O .I errno
201 .\"O set to indicate the error.
202 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
203 .BR sigset ()
204 ¤Ï \-1 ¤òÊÖ¤·¡¢
205 .I errno
206 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£
207 .\"O (But see BUGS below.)
208 ⤷¡¢°Ê²¼¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È¤Î¤³¤È¡£
209
210 .\"O The
211 .\"O .BR sighold (),
212 .\"O .BR sigrelse (),
213 .\"O and
214 .\"O .BR sigignore ()
215 .\"O functions return 0 on success; on error, these functions return \-1 and set
216 .\"O .I errno
217 .\"O to indicate the error.
218 ´Ø¿ô
219 .BR sighold (),
220 .BR sigrelse (),
221 .BR sigignore ()
222 ¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
223 .I errno
224 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£
225 .\"O .SH ERRORS
226 .SH ¥¨¥é¡¼
227 .\"O For
228 .\"O .BR sigset ()
229 .\"O see the ERRORS under
230 .\"O .BR sigaction (2)
231 .\"O and
232 .\"O .BR sigprocmask (2).
233 .BR sigset ()
234 ¤Ë´Ø¤·¤Æ¤Ï¡¢
235 .BR sigaction (2)
236 ¤È
237 .BR sigprocmask (2)
238 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
239
240 .\"O For
241 .\"O .BR sighold ()
242 .\"O and
243 .\"O .BR sigrelse ()
244 .\"O see the ERRORS under
245 .\"O .BR sigprocmask (2).
246 .BR sighold ()
247 ¤È
248 .BR sigrelse ()
249 ¤Ë´Ø¤·¤Æ¤Ï¡¢
250 .BR sigprocmask (2)
251 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
252
253 .\"O For
254 .\"O .BR sigignore (),
255 .\"O see the errors under
256 .\"O .BR sigaction (2).
257 .BR sigignore ()
258 ¤Ë´Ø¤·¤Æ¤Ï¡¢
259 .BR sigaction (2)
260 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
261 .\"O .SH "CONFORMING TO"
262 .SH ½àµò
263 SVr4, POSIX.1-2001.
264 .\"O These functions are obsolete: do not use them in new programs.
265 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£
266 .\"O POSIX.1-2008 marks
267 .\"O .BR sighold (),
268 .\"O .BR sigignore (),
269 .\"O .BR sigpause (),
270 .\"O .BR sigrelse (),
271 .\"O and
272 .\"O .BR sigset ()
273 .\"O as obsolete, recommending the use of
274 .\"O .BR sigaction (2),
275 .\"O .BR sigprocmask (2),
276 .\"O .BR pthread_sigmask (3),
277 .\"O and
278 .\"O .BR sigsuspend (2)
279 .\"O instead.
280 POSIX.1-2008 ¤Ï¡¢
281 .BR sighold (),
282 .BR sigignore (),
283 .BR sigpause (),
284 .BR sigrelse (),
285 .BR sigset ()
286 ¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£
287 Âå¤ï¤ê¤Ë¡¢
288 .BR sigaction (2),
289 .BR sigprocmask (2),
290 .BR pthread_sigmask (3),
291 .BR sigsuspend (2)
292 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
293 .\"O .SH NOTES
294 .SH Ãí°Õ
295 .\"O These functions appeared in glibc version 2.1.
296 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1 ¤ÇÅо줷¤¿¡£
297
298 .\"O The
299 .\"O .I sighandler_t
300 .\"O type is a GNU extension; it is only used on this page to make the
301 .\"O .BR sigset ()
302 .\"O prototype more easily readable.
303 .I sighandler_t
304 ·¿¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢¤³¤Î man page ¤Ç
305 .BR sigset ()
306 ¤Î¥×¥í¥È¥¿¥¤¥×¤ò¤è¤êÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£
307
308 .\"O The
309 .\"O .BR sigset ()
310 .\"O function provides reliable signal handling semantics (as when calling
311 .\"O .BR sigaction (2)
312 .\"O with
313 .\"O .I sa_mask
314 .\"O equal to 0).
315 ´Ø¿ô
316 .BR sigset ()
317 ¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë
318 .RI ( sa_mask
319 ¤ò 0 ¤Ç
320 .BR sigaction (2)
321 ¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£
322
323 .\"O On System V, the
324 .\"O .BR signal ()
325 .\"O function provides unreliable semantics (as when calling
326 .\"O .BR sigaction (2)
327 .\"O with
328 .\"O .I sa_mask
329 .\"O equal to
330 .\"O .IR "SA_RESETHAND | SA_NODEFER" ).
331 System V ¤Ç¤Ï¡¢´Ø¿ô
332 .BR signal ()
333 ¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ­¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë
334 .RI ( sa_mask
335 ¤ò
336 .IR "SA_RESETHAND | SA_NODEFER"
337 ¤È¤·¤Æ
338 .BR sigaction (2)
339 ¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤­¤ÈƱÍÍ)¡£
340 .\"O On BSD,
341 .\"O .BR signal ()
342 .\"O provides reliable semantics.
343 BSD ¤Ç¤Ï¡¢
344 .BR signal ()
345 ¤Ï¿®ÍêÀ­¤Î¤¢¤ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë¡£
346 .\"O POSIX.1-2001 leaves these aspects of
347 .\"O .BR signal ()
348 .\"O unspecified.
349 POSIX.1-2001 ¤Ç¤Ï¡¢
350 .BR signal ()
351 ¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
352 .\"O See
353 .\"O .BR signal (2)
354 .\"O for further details.
355 ¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
356 .BR signal (2)
357 ¤ò»²¾È¡£
358
359 .\"O In order to wait for a signal,
360 .\"O BSD and System V both provided a function named
361 .\"O .BR sigpause (3),
362 .\"O but this function has a different argument on the two systems.
363 .\"O See
364 .\"O .BR sigpause (3)
365 .\"O for details.
366 BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â
367 ¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢
368 .BR sigpause (3)
369 ¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢
370 ¤³¤Î´Ø¿ô¤Î°ú¤­¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£
371 ¾ÜºÙ¤Ï
372 .BR sigpause (3)
373 ¤ò»²¾È¡£
374 .\"O .SH BUGS
375 .SH ¥Ð¥°
376 .\"O In versions of glibc before 2.2,
377 .\"O .BR sigset ()
378 .\"O did not unblock
379 .\"O .I sig
380 .\"O if
381 .\"O .I disp
382 .\"O was specified as a value other than
383 .\"O .BR SIG_HOLD .
384 2.2 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢
385 .I disp
386 ¤Ë
387 .B SIG_HOLD
388 °Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
389 .I sig
390 ¤Î¥Ö¥í¥Ã¥¯²ò½ü¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
391
392 .\"O In all versions of glibc up to and including 2.3.5,
393 .\"O .BR sigset ()
394 .\"O does not correctly return the previous disposition of the signal
395 .\"O in two cases.
396 2.3.5 °ÊÁ°¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢
397 .BR sigset ()
398 ¤¬Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÀµ¤·¤¯ÊÖ¤µ¤Ê¤¤¾ì¹ç¤¬ 2¤Ä¤¢¤ë¡£
399 .\"O First, if
400 .\"O .I disp
401 .\"O is specified as
402 .\"O .BR SIG_HOLD ,
403 .\"O then a successful
404 .\"O .BR sigset ()
405 .\"O always returns
406 .\"O .BR SIG_HOLD .
407 .\"O Instead, it should return the previous disposition of the signal
408 .\"O (unless the signal was blocked, in which case
409 .\"O .B SIG_HOLD
410 .\"O should be returned).
411 °ì¤Ä¤á¤Ï¡¢
412 .I disp
413 ¤Ë
414 .B SIG_HOLD
415 ¤¬»ØÄꤵ¤ì¤ë¤È¡¢À®¸ù¤·¤¿¾ì¹ç
416 .BR sigset ()
417 ¤Ï¾ï¤Ë
418 .B SIG_HOLD
419 ¤òÊÖ¤¹¤³¤È¤Ç¤¢¤ë¡£
420 Àµ¤·¤¯¤Ï¡¢(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï)
421 Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë
422 (¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢
423 .B SIG_HOLD
424 ¤¬ÊÖ¤µ¤ì¤ë)¡£
425 .\"O Second, if the signal is currently blocked, then
426 .\"O the return value of a successful
427 .\"O .BR sigset ()
428 .\"O should be
429 .\"O .BR SIG_HOLD .
430 .\"O Instead, the previous disposition of the signal is returned.
431 ¤â¤¦°ì¤Ä¤Ï¡¢¥·¥°¥Ê¥ë¤¬¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
432 À®¸ù¤·¤¿¾ì¹ç¤Î
433 .BR sigset ()
434 ¤ÎÊÖ¤êÃͤÏ
435 .B SIG_HOLD
436 ¤Ë¤Ê¤ë¤Ù¤­¤Ç¤¢¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï
437 Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤¬ÊÖ¤µ¤ì¤ë¤³¤È¤Ç¤¢¤ë¡£
438 .\"O These problems have been fixed since glibc 2.5.
439 ¤³¤ì¤é¤ÎÌäÂê¤Ï glibc 2.5 °Ê¹ß¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£
440 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
441 .\"O .SH "SEE ALSO"
442 .SH ´ØÏ¢¹àÌÜ
443 .BR kill (2),
444 .BR pause (2),
445 .BR sigaction (2),
446 .BR signal (2),
447 .BR sigprocmask (2),
448 .BR raise (3),
449 .BR sigpause (3),
450 .BR sigvec (3),
451 .BR feature_test_macros (7),
452 .BR signal (7)