2 .\" Copyright (c) 2005 by Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
25 .\" Translated 2005-12-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .TH SIGSET 3 2009-03-15 "Linux" "Linux Programmer's Manual"
30 .\"O sigset, sighold, sigrelse, sigignore \- System V signal API
31 sigset, sighold, sigrelse, sigignore \- System V ÈÇ¥·¥°¥Ê¥ë API
34 .B #define _XOPEN_SOURCE 500
36 .B #include <signal.h>
38 .B typedef void (*sighandler_t)(int);
40 .BI "sighandler_t sigset(int " sig ", sighandler_t " disp );
42 .BI "int sighold(int " sig );
44 .BI "int sigrelse(int " sig );
46 .BI "int sigignore(int " sig );
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),
55 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ÀΤʤ¬¤é¤Î System V ÈÇ¥·¥°¥Ê¥ë API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à
56 ¤ËÂФ·¤Æ¸ß´¹À¤Î¤¢¤ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò glibc ¤ÇÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
57 ¤³¤Î API ¤Ï²áµî¤Î¤â¤Î¤Ç¤¢¤ê¡¢¿·¤·¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï
61 ¤Ê¤É) ¤ò»ÈÍѤ¹¤Ù¤¤Ç¤¢¤ë¡£
65 .\"O function modifies the disposition of the signal
69 .\"O argument can be the address of a signal handler function,
70 .\"O or one of the following constants:
75 ¤Î¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÆ°ºî¤òÊѹ¹¤¹¤ë¡£
77 °ú¤¿ô¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Î¥¢¥É¥ì¥¹¤«¡¢
78 °Ê²¼¤ÎÄê¿ô¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤¤ë¡£
81 .\"O Reset the disposition of
85 ¤ÎÆ°ºî¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£
96 .\"O to the process's signal mask, but leave the disposition of
99 ¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
107 .\"O specifies the address of a signal handler, then
109 .\"O is added to the process's signal mask during execution of the handler.
111 ¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
112 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
118 .\"O was specified as a value other than
122 .\"O is removed from the process's signal mask.
126 °Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
127 ¤½¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é
131 .\"O The dispositions for
135 .\"O cannot be changed.
140 ¤ËÂФ¹¤ëÆ°ºî¤ÏÊѹ¹¤Ç¤¤Ê¤¤¡£
146 .\"O to the calling process's signal mask.
149 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë
155 .\"O function removes
157 .\"O from the calling process's signal mask.
160 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤«¤é
165 .\"O .BR sigignore ()
166 .\"O function sets the disposition of
177 .\"O .SH RETURN VALUE
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.
192 ¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï
195 ¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï
196 Êѹ¹Á°¤Î¤½¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¡£
199 .\"O returns \-1, with
201 .\"O set to indicate the error.
206 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£
207 .\"O (But see BUGS below.)
208 ⤷¡¢°Ê²¼¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È¤Î¤³¤È¡£
212 .\"O .BR sigrelse (),
214 .\"O .BR sigignore ()
215 .\"O functions return 0 on success; on error, these functions return \-1 and set
217 .\"O to indicate the error.
222 ¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
224 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤò¥»¥Ã¥È¤¹¤ë¡£
229 .\"O see the ERRORS under
230 .\"O .BR sigaction (2)
232 .\"O .BR sigprocmask (2).
238 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
244 .\"O see the ERRORS under
245 .\"O .BR sigprocmask (2).
251 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
254 .\"O .BR sigignore (),
255 .\"O see the errors under
256 .\"O .BR sigaction (2).
260 ¤Î¡Ö¥¨¥é¡¼¡×¤ÎÀá¤ò»²¾È¡£
261 .\"O .SH "CONFORMING TO"
264 .\"O These functions are obsolete: do not use them in new programs.
265 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£¿·¤·¤¤¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¡£
266 .\"O POSIX.1-2008 marks
268 .\"O .BR sigignore (),
269 .\"O .BR sigpause (),
270 .\"O .BR sigrelse (),
273 .\"O as obsolete, recommending the use of
274 .\"O .BR sigaction (2),
275 .\"O .BR sigprocmask (2),
276 .\"O .BR pthread_sigmask (3),
278 .\"O .BR sigsuspend (2)
286 ¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£
290 .BR pthread_sigmask (3),
292 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
295 .\"O These functions appeared in glibc version 2.1.
296 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1 ¤ÇÅо줷¤¿¡£
300 .\"O type is a GNU extension; it is only used on this page to make the
302 .\"O prototype more easily readable.
304 ·¿¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ê¡¢¤³¤Î man page ¤Ç
306 ¤Î¥×¥í¥È¥¿¥¤¥×¤ò¤è¤êÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£
310 .\"O function provides reliable signal handling semantics (as when calling
311 .\"O .BR sigaction (2)
317 ¤Ï¿®ÍêÀ¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë
321 ¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤¤ÈƱÍÍ)¡£
323 .\"O On System V, the
325 .\"O function provides unreliable semantics (as when calling
326 .\"O .BR sigaction (2)
330 .\"O .IR "SA_RESETHAND | SA_NODEFER" ).
333 ¤¬Ä󶡤¹¤ë½èÍýµ¡¹½¤Ï¿®ÍêÀ¤Î¤Ê¤¤¤â¤Î¤Ç¤¢¤ë
336 .IR "SA_RESETHAND | SA_NODEFER"
339 ¤ò¸Æ¤Ó½Ð¤·¤¿¤È¤¤ÈƱÍÍ)¡£
342 .\"O provides reliable semantics.
345 ¤Ï¿®ÍêÀ¤Î¤¢¤ë½èÍýµ¡¹½¤òÄ󶡤¹¤ë¡£
346 .\"O POSIX.1-2001 leaves these aspects of
351 ¤Î¤³¤ÎÅÀ¤Ïµ¬Äꤷ¤Ê¤¤¤Þ¤Þ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
354 .\"O for further details.
355 ¤µ¤é¤Ê¤ë¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
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.
364 .\"O .BR sigpause (3)
366 BSD ¤È System V ¤Î¤É¤Á¤é¤Î¥·¥¹¥Æ¥à¤Ç¤â
367 ¥·¥°¥Ê¥ë¤òÂԤĤ¿¤á¤Ë¡¢
369 ¤È¤¤¤¦Ì¾Á°¤Î´Ø¿ô¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¤¬¡¢
370 ¤³¤Î´Ø¿ô¤Î°ú¤¿ô¤ÏξÊý¤Î¥·¥¹¥Æ¥à¤Ç°Û¤Ê¤ë¡£
376 .\"O In versions of glibc before 2.2,
382 .\"O was specified as a value other than
384 2.2 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢
388 °Ê³°¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
390 ¤Î¥Ö¥í¥Ã¥¯²ò½ü¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
392 .\"O In all versions of glibc up to and including 2.3.5,
394 .\"O does not correctly return the previous disposition of the signal
396 2.3.5 °ÊÁ°¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢
398 ¤¬Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÀµ¤·¤¯ÊÖ¤µ¤Ê¤¤¾ì¹ç¤¬ 2¤Ä¤¢¤ë¡£
403 .\"O then a successful
407 .\"O Instead, it should return the previous disposition of the signal
408 .\"O (unless the signal was blocked, in which case
410 .\"O should be returned).
415 ¤¬»ØÄꤵ¤ì¤ë¤È¡¢À®¸ù¤·¤¿¾ì¹ç
420 Àµ¤·¤¯¤Ï¡¢(¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï)
421 Êѹ¹Á°¤Î¥·¥°¥Ê¥ë¤ÎÆ°ºî¤òÊÖ¤¹¤Ù¤¤Ç¤¢¤ë
422 (¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢
425 .\"O Second, if the signal is currently blocked, then
426 .\"O the return value of a successful
430 .\"O Instead, the previous disposition of the signal is returned.
431 ¤â¤¦°ì¤Ä¤Ï¡¢¥·¥°¥Ê¥ë¤¬¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
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
451 .BR feature_test_macros (7),