2 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" and Copyright (c) 2002, 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
5 .\" <mtk.manpages@gmail.com>
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date. The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein. The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl)
29 .\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl)
30 .\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl)
31 .\" Modified 10 Apr 2002, by Michael Kerrisk <mtk.manpages@gmail.com>
32 .\" Modified 7 Jun 2002, by Michael Kerrisk <mtk.manpages@gmail.com>
33 .\" Added information on real-time signals
34 .\" Modified 13 Jun 2002, by Michael Kerrisk <mtk.manpages@gmail.com>
35 .\" Noted that SIGSTKFLT is in fact unused
36 .\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING
37 .\" 2006-04-24, mtk, Added text on changing signal dispositions,
38 .\" signal mask, and pending signals.
40 .\" Added section on system call restarting (SA_RESTART)
41 .\" Added section on stop/cont signals interrupting syscalls.
42 .\" 2008-10-05, mtk: various additions
44 .\" Japanese Version Copyright (c) 1997 Takafumi Naka
45 .\" and 2005-2008 Akihiro MOTOKI
46 .\" all rights reserved.
47 .\" Translated 1997-02-13, Takafumi Naka <takafumi@yk.rim.or.jp>
48 .\" Modified 1999-06-22, Tatsuo SEKINE <tsekine@isoternet.org>
49 .\" Modified 1999-07-18, Takafumi Naka <takafumi@yk.rim.or.jp>
50 .\" Modified 1999-12-06, NAKANO Takeo <nakano@apm.seikei.ac.jp>, LDP v1.28
51 .\" Updated 2003-07-24, Kentaro Shirakata <argrath@ub32.org>
52 .\" Updated 2005-02-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
53 .\" Updated 2006-07-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
54 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.50
55 .\" Updated 2007-09-08, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
56 .\" Updated 2008-08-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
57 .\" Updated 2008-11-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
58 .\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
60 .\"WORD: disposition ½èÍýÊýË¡
61 .\"WORD: pending ½èÍýÂÔ¤Á
62 .\"WORD: signal handler ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é
64 .TH SIGNAL 7 2011-09-18 "Linux" "Linux Programmer's Manual"
66 .\"O signal \- overview of signals
68 signal \- ¥·¥°¥Ê¥ë¤Î³µÍ×
71 .\"O Linux supports both POSIX reliable signals (hereinafter
72 .\"O "standard signals") and POSIX real-time signals.
73 Linux ¤Ï POSIX ¿®Íꥷ¥°¥Ê¥ë (reliable signal; °Ê¸å "ɸ½à¥·¥°¥Ê¥ë"¤Èɽµ)
74 ¤È POSIX ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤ËÂбþ¤·¤Æ¤¤¤ë¡£
75 .\"O .SS "Signal Dispositions"
77 .\"O Each signal has a current
78 .\"O .IR disposition ,
79 .\"O which determines how the process behaves when it is delivered
81 ¥·¥°¥Ê¥ë¤Ï¤½¤ì¤¾¤ì¸½ºß¤Î¡Ö½èÍýÊýË¡ (disposition)¡×¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢
82 ¤³¤Î½èÍýÊýË¡¤Ë¤è¤ê¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿ºÝ¤Ë¥×¥í¥»¥¹¤¬
83 ¤É¤Î¤è¤¦¤Ê¿¶Éñ¤¤¤ò¤¹¤ë¤«¤¬·è¤Þ¤ë¡£
85 .\"O The entries in the "Action" column of the tables below specify
86 .\"O the default disposition for each signal, as follows:
87 ¸å½Ò¤Îɽ¤Î "Æ°ºî" ¤ÎÍó¤Î¥¨¥ó¥È¥ê¤Ï³Æ¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤Î
88 ½èÍýÊýË¡¤ò¼¨¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£
90 .\"O Default action is to terminate the process.
91 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¡£
93 .\"O Default action is to ignore the signal.
94 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¤³¤Î¥·¥°¥Ê¥ë¤Î̵»ë¡£
96 .\"O Default action is to terminate the process and dump core (see
98 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¤È¥³¥¢¥À¥ó¥×½ÐÎÏ
102 .\"O Default action is to stop the process.
103 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹¤Î°ì»þÄä»ß¡£
105 .\"O Default action is to continue the process if it is currently stopped.
106 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤¬Ää»ßÃæ¤Î¾ì¹ç¤Ë¤½¤Î¼Â¹Ô¤ÎºÆ³«¡£
108 .\"O A process can change the disposition of a signal using
109 .\"O .BR sigaction (2)
112 .\"O (The latter is less portable when establishing a signal handler;
120 ¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤¤ë
122 ¤ÎÊý¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Î°Ü¿¢À¤¬Ä㤤;
126 .\"O Using these system calls, a process can elect one of the
127 .\"O following behaviors to occur on delivery of the signal:
128 .\"O perform the default action; ignore the signal;
129 .\"O or catch the signal with a
130 .\"O .IR "signal handler" ,
131 .\"O a programmer-defined function that is automatically invoked
132 .\"O when the signal is delivered.
133 .\"O (By default, the signal handler is invoked on the
134 .\"O normal process stack.
135 .\"O It is possible to arrange that the signal handler
136 .\"O uses an alternate stack; see
137 .\"O .BR sigaltstack (2)
138 .\"O for a discussion of how to do this and when it might be useful.)
139 ¥·¥°¥Ê¥ë¤ÎÇÛÁ÷»þ¤Ëµ¯¤³¤ëÆ°ºî¤È¤·¤Æ
140 ¥×¥í¥»¥¹¤¬ÁªÂò¤Ç¤¤ë¤Î¤Ï¡¢¼¡¤Î¤¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë¡£
141 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤ò¼Â¹Ô¤¹¤ë¡¢¥·¥°¥Ê¥ë¤ò̵»ë¤¹¤ë¡¢
142 .I "¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é (signal handler)"
143 ¤Ç¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¡£¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤È¤Ï¡¢¥·¥°¥Ê¥ëÇÛÁ÷»þ¤Ë
144 ¼«Æ°Åª¤Ëµ¯Æ°¤µ¤ì¤ë¥×¥í¥°¥é¥ÞÄêµÁ¤Î´Ø¿ô¤Ç¤¢¤ë¡£
145 (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÏÄ̾ï¤Î¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¾å¤Çµ¯Æ°¤µ¤ì¤ë¡£
146 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÂåÂØ¥¹¥¿¥Ã¥¯ (alternate stack) ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ë
147 ¤³¤È¤â¤Ç¤¤ë¡£ÂåÂØ¥¹¥¿¥Ã¥¯¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤹ¤ëÊýË¡¤È¡¢¤É¤Î¤è¤¦¤ÊºÝ¤Ë
148 ÂåÂØ¥¹¥¿¥Ã¥¯¤¬Ìò¤ËΩ¤Ä¤«¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ë¤Ä¤¤¤Æ¤Ï
152 .\"O The signal disposition is a per-process attribute:
153 .\"O in a multithreaded application, the disposition of a
154 .\"O particular signal is the same for all threads.
155 ¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥×¥í¥»¥¹Ã±°Ì¤Î°À¤Ç¤¢¤ë¡£
156 ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï
157 Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£
159 .\"O A child created via
161 .\"O inherits a copy of its parent's signal dispositions.
164 .\"O the dispositions of handled signals are reset to the default;
165 .\"O the dispositions of ignored signals are left unchanged.
167 ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£
169 ¤Î´Ö¡¢¥Ï¥ó¥É¥é¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È
170 ¤µ¤ì¡¢Ìµ»ë¤È¤Ê¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£
171 .\"O .SS Sending a Signal
173 .\"O The following system calls and library functions allow
174 .\"O the caller to send a signal:
175 °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤Ã¤Æ¡¢
176 ¸Æ¤Ó½Ð¤·¼Ô¤Ï¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
179 .\"O Sends a signal to the calling thread.
180 ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
183 .\"O Sends a signal to a specified process,
184 .\"O to all members of a specified process group,
185 .\"O or to all processes on the system.
186 »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ä¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¡¢
187 ¥·¥¹¥Æ¥à¤ÎÁ´¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
190 .\"O Sends a signal to all of the members of a specified process group.
191 »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
194 .\"O Sends a signal to a specified POSIX thread in the same process as
196 ¸Æ¤Ó½Ð¤·¼Ô¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿ POSIX ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
199 .\"O Sends a signal to a specified thread within a specific process.
200 .\"O (This is the system call used to implement
201 .\"O .BR pthread_kill (3).)
202 »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë
203 (¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ
208 .\"O Sends a real-time signal with accompanying data to a specified process.
209 »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤ËÉÕ°¥Ç¡¼¥¿¤È¤È¤â¤Ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
210 .\"O .SS Waiting for a Signal to be Caught
211 .SS ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Î¤òÂÔ¤Ä
212 .\"O The following system calls suspend execution of the calling process
213 .\"O or thread until a signal is caught
214 .\"O (or an unhandled signal terminates the process):
215 °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç
216 ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ä¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÃæÃÇ (suspend) ¤¹¤ë¤³¤È¤¬¤Ç¤¤ë
217 (¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤è¤ê¤½¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿
218 ¾ì¹ç¤Ë¤â¼Â¹Ô¤ÎÄä»ß¤Ï½ªÎ»¤¹¤ë)¡£
221 .\"O Suspends execution until any signal is caught.
222 ²¿¤«¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß¤¹¤ë¡£
225 .\"O Temporarily changes the signal mask (see below) and suspends
226 .\"O execution until one of the unmasked signals is caught.
227 °ì»þŪ¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (²¼µ»²¾È) ¤òÊѹ¹¤·¡¢
228 ¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Î¤¤¤º¤ì¤«¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç
230 .\"O .SS Synchronously Accepting a Signal
231 .SS ¥·¥°¥Ê¥ë¤ÎƱ´ü¼õ¿®
232 .\"O Rather than asynchronously catching a signal via a signal handler,
233 .\"O it is possible to synchronously accept the signal, that is,
234 .\"O to block execution until the signal is delivered,
235 .\"O at which point the kernel returns information about the
236 .\"O signal to the caller.
237 .\"O There are two general ways to do this:
238 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é·Ðͳ¤Ç¥·¥°¥Ê¥ë¤òÈóƱ´ü (asynchronously) ¤ÇÊ᪤¹¤ë°Ê³°¤Ë¤â¡¢
239 ¥·¥°¥Ê¥ë¤òƱ´ü (synchronously) ¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤³¤È¤â¤Ç¤¤ë¡£
240 Ʊ´ü¤·¤Æ¼õ¤±ÉÕ¤±¤ë¤È¤Ï¡¢¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß (block)
241 ¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£¥·¥°¥Ê¥ë¤ò¼õ¤±ÉÕ¤±¤¿ºÝ¤Ë¡¢¥«¡¼¥Í¥ë¤Ï
242 ¤½¤Î¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¸Æ¤Ó½Ð¤·¼Ô¤ËÊÖ¤¹¡£
243 ¤³¤ì¤ò¹Ô¤¦°ìÈÌŪ¤ÊÊýË¡¤¬Æó¤Ä¤¢¤ë¡£
245 .\"O .BR sigwaitinfo (2),
246 .\"O .BR sigtimedwait (2),
249 .\"O suspend execution until one of the signals in a specified
250 .\"O set is delivered.
251 .\"O Each of these calls returns information about the delivered signal.
253 .BR sigtimedwait (2),
255 ¤Ï¡¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÃæÃǤ¹¤ë¡£
256 ¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä´Ø¿ô¤Ç¤â¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£
258 .\"O .BR signalfd (2)
259 .\"O returns a file descriptor that can be used to read information
260 .\"O about signals that are delivered to the caller.
263 .\"O from this file descriptor blocks until one of the signals
264 .\"O in the set specified in the
265 .\"O .BR signalfd (2)
266 .\"O call is delivered to the caller.
267 .\"O The buffer returned by
269 .\"O contains a structure describing the signal.
271 ¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÇÛÁ÷¤µ¤ì¤¿
272 ¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤¤ë¡£
273 ¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
277 ¤Î¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬¸Æ¤Ó½Ð¤·¸µ¤Ë
278 ÇÛÁ÷¤µ¤ì¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£
280 ¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò³ÊǼ¤·¤¿¹½Â¤ÂΤ¬Æþ¤Ã¤Æ¤¤¤ë¡£
281 .\"O .SS "Signal Mask and Pending Signals"
282 .SS ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë
285 .\"O which means that it will not be delivered until it is later unblocked.
286 .\"O Between the time when it is generated and when it is delivered
287 .\"O a signal is said to be
290 .I "¥Ö¥í¥Ã¥¯ (block)"
291 ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï
292 ¤½¤Î¸å¥Ö¥í¥Ã¥¯¤ò²ò½ü¤µ¤ì¤ë¤Þ¤ÇÇÛÁ÷¤µ¤ì¤Ê¤¯¤Ê¤ë¡£
293 ¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤Æ¤«¤éÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï
294 .I "½èÍýÂÔ¤Á (pending)"
297 .\"O Each thread in a process has an independent
298 .\"O .IR "signal mask" ,
299 .\"O which indicates the set of signals that the thread is currently blocking.
300 .\"O A thread can manipulate its signal mask using
301 .\"O .BR pthread_sigmask (3).
302 .\"O In a traditional single-threaded application,
303 .\"O .BR sigprocmask (2)
304 .\"O can be used to manipulate the signal mask.
305 ¥×¥í¥»¥¹Æâ¤Î³Æ¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤ì¤¾¤ìÆÈΩ¤Ê
306 .I "¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (signal mask)"
307 ¤ò»ý¤Ä¡£¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤ë
308 ¥·¥°¥Ê¥ë½¸¹ç¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£
310 .BR pthread_sigmask (3)
311 ¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤¤ë¡£
312 ÅÁÅýŪ¤Ê¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
314 ¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤¤ë¡£
316 .\"O A child created via
318 .\"O inherits a copy of its parent's signal mask;
319 .\"O the signal mask is preserved across
322 ·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢
323 ¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£
325 ¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£
327 .\"O A signal may be generated (and thus pending)
328 .\"O for a process as a whole (e.g., when sent using
330 .\"O or for a specific thread (e.g., certain signals,
336 .\"O consequence of executing a specific machine-language instruction
337 .\"O are thread directed, as are signals targeted at a specific thread using
338 .\"O .BR pthread_kill (3)).
339 .\"O A process-directed signal may be delivered to any one of the
340 .\"O threads that does not currently have the signal blocked.
341 .\"O If more than one of the threads has the signal unblocked, then the
342 .\"O kernel chooses an arbitrary thread to which to deliver the signal.
343 À¸À®¤µ¤ì¤ë¥·¥°¥Ê¥ë (¤·¤¿¤¬¤Ã¤Æ½èÍýÂÔ¤Á¤È¤Ê¤ë¥·¥°¥Ê¥ë) ¤Ë¤Ï¡¢
344 ¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤ÈÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤¬¤¢¤ë¡£
345 Î㤨¤Ð¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï
348 ÆÃÄê¤Î¥Þ¥·¥ó¸ì¤ÎÌ¿Îá¤Î¼Â¹Ô¤Î·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¡¢
352 ¤Ê¤É¤Î¥·¥°¥Ê¥ë¤Ï¡¢¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£
355 ¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤ËÀ¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤â
357 ¥×¥í¥»¥¹°¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤Î¤¦¤Á
358 ¤¤¤º¤ì¤«¤Î°ì¤Ä¤ËÇÛÁ÷¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤
359 ¥¹¥ì¥Ã¥É¤¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤òÇÛÁ÷¤¹¤ë¥¹¥ì¥Ã¥É¤Ï¥«¡¼¥Í¥ë¤¬
362 .\"O A thread can obtain the set of signals that it currently has pending
364 .\"O .BR sigpending (2).
365 .\"O This set will consist of the union of the set of pending
366 .\"O process-directed signals and the set of signals pending for
367 .\"O the calling thread.
370 ¤ò»È¤Ã¤Æ¡¢¸½ºß½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
371 ¤³¤Î½¸¹ç¤Ï¡¢¥×¥í¥»¥¹°¸¤Æ¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È
372 ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ÎξÊý¤«¤é¹½À®¤µ¤ì¤ë¡£
374 .\"O A child created via
376 .\"O initially has an empty pending signal set;
377 .\"O the pending signal set is preserved across an
380 ·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¤Ï¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤Ï
381 ¶õ¤Î½¸¹ç¤Ç½é´ü²½¤µ¤ì¤ë¡£
383 ¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£
384 .\"O .SS "Standard Signals"
386 .\"O Linux supports the standard signals listed below.
387 .\"O Several signal numbers
388 .\"O are architecture-dependent, as indicated in the "Value" column.
389 .\"O (Where three values are given, the first one is usually valid for
390 .\"O alpha and sparc,
391 .\"O the middle one for ix86, ia64, ppc, s390, arm and sh,
392 .\"O and the last one for mips.
393 Linux ¤Ï°Ê²¼¤Ë¼¨¤¹É¸½à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤¤¤ë¡£
394 ¥·¥°¥Ê¥ëÈÖ¹æ¤Î°ìÉô¤Ï¥¢¡¼¥¥Æ¥¯¥Á¥ã°Í¸¤Ç¤¢¤ê¡¢"ÃÍ" Íó¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£
395 (3¤Ä¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¡¢ 1¤ÄÌܤ¬ alpha ¤È sparc ¤ÇÄ̾ï͸ú¤ÊÃÍ¡¢
396 ¿¿¤óÃ椬 ix86, ia64, ppc, s390, arm, sh ¤Ç¤ÎÃÍ¡¢ºÇ¸å¤¬ mips ¤Ç¤ÎÃͤǤ¢¤ë¡£
397 .\" parisc is a law unto itself
398 .\"O A \- denotes that a signal is absent on the corresponding architecture.)
399 \- ¤Ï¤½¤Î¥¢¡¼¥¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë¥·¥°¥Ê¥ë¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£)
401 .\"O First the signals described in the original POSIX.1-1990 standard.
402 ºÇ½é¤Ë¡¢POSIX.1-1990 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
407 .\"O Signal Value Action Comment
408 ¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È
409 .\"O SIGHUP \01 Term Hangup detected on controlling terminal
410 .\"O or death of controlling process
412 À©¸æüËö(controlling terminal)¤Î¥Ï¥ó¥°¥¢¥Ã¥×¸¡½Ð¡¢
413 ¤Þ¤¿¤ÏÀ©¸æ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î»à
415 .\"O SIGINT \02 Term Interrupt from keyboard
416 .\"O SIGQUIT \03 Core Quit from keyboard
417 .\"O SIGILL \04 Core Illegal Instruction
418 .\"O SIGABRT \06 Core Abort signal from \fBabort\fP(3)
419 .\"O SIGFPE \08 Core Floating point exception
420 .\"O SIGKILL \09 Term Kill signal
421 SIGINT \02 Term ¥¡¼¥Ü¡¼¥É¤«¤é¤Î³ä¤ê¹þ¤ß (Interrupt)
422 SIGQUIT \03 Core ¥¡¼¥Ü¡¼¥É¤Ë¤è¤ëÃæ»ß (Quit)
423 SIGILL \04 Core ÉÔÀµ¤ÊÌ¿Îá
424 SIGABRT \06 Core \fBabort\fP(3) ¤«¤é¤ÎÃæÃÇ (Abort) ¥·¥°¥Ê¥ë
425 SIGFPE \08 Core ÉâÆ°¾®¿ôÅÀÎã³°
426 SIGKILL \09 Term Kill ¥·¥°¥Ê¥ë
427 .\"O SIGSEGV 11 Core Invalid memory reference
428 .\"O SIGPIPE 13 Term Broken pipe: write to pipe with no
430 .\"O SIGALRM 14 Term Timer signal from \fBalarm\fP(2)
431 .\"O SIGTERM 15 Term Termination signal
432 SIGSEGV 11 Core ÉÔÀµ¤Ê¥á¥â¥ê»²¾È
433 SIGPIPE 13 Term ¥Ñ¥¤¥×Ç˲õ: Æɤ߼ê¤Î̵¤¤¥Ñ¥¤¥×¤Ø¤Î½ñ¤½Ð¤·
434 SIGALRM 14 Term \fBalarm\fP(2) ¤«¤é¤Î¥¿¥¤¥Þ¡¼¥·¥°¥Ê¥ë
435 SIGTERM 15 Term ½ªÎ» (termination) ¥·¥°¥Ê¥ë
436 .\"O SIGUSR1 30,10,16 Term User-defined signal 1
437 .\"O SIGUSR2 31,12,17 Term User-defined signal 2
438 .\"O SIGCHLD 20,17,18 Ign Child stopped or terminated
439 .\"O SIGCONT 19,18,25 Cont Continue if stopped
440 SIGUSR1 30,10,16 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 1
441 SIGUSR2 31,12,17 Term ¥æ¡¼¥¶ÄêµÁ¥·¥°¥Ê¥ë 2
442 SIGCHLD 20,17,18 Ign »Ò¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop) ¤Þ¤¿¤Ï½ªÎ»
443 SIGCONT 19,18,25 Cont °ì»þÄä»ß (stop) ¤«¤é¤ÎºÆ³«
444 .\"O SIGSTOP 17,19,23 Stop Stop process
445 .\"O SIGTSTP 18,20,24 Stop Stop typed at tty
446 .\"O SIGTTIN 21,21,26 Stop tty input for background process
447 .\"O SIGTTOU 22,22,27 Stop tty output for background process
448 SIGSTOP 17,19,23 Stop ¥×¥í¥»¥¹¤Î°ì»þÄä»ß (stop)
449 SIGTSTP 18,20,24 Stop üËö (tty) ¤è¤êÆþÎϤµ¤ì¤¿°ì»þÄä»ß (stop)
450 SIGTTIN 21,21,26 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ÆþÎÏ
451 SIGTTOU 22,22,27 Stop ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥×¥í¥»¥¹¤Î tty ½ÐÎÏ
458 .\"O cannot be caught, blocked, or ignored.
463 ¤Ï¥¥ã¥Ã¥Á¡¢¥Ö¥í¥Ã¥¯¡¢Ìµ»ë¤Ç¤¤Ê¤¤¡£
465 .\"O Next the signals not in the POSIX.1-1990 standard but described in
466 .\"O SUSv2 and POSIX.1-2001.
467 ¼¡¤Ë¡¢ POSIX.1-1990 ɸ½à¤Ë¤Ï¤Ê¤¤¤¬¡¢ SUSv2 ¤È
468 POSIX.1-2001 ¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
473 .\"O Signal Value Action Comment
474 ¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È
475 .\"O SIGBUS 10,7,10 Core Bus error (bad memory access)
476 .\"O SIGPOLL Term Pollable event (Sys V).
477 .\"O Synonym for \fBSIGIO\fP
478 .\"O SIGPROF 27,27,29 Term Profiling timer expired
479 SIGBUS 10,7,10 Core ¥Ð¥¹¥¨¥é¡¼ (ÉÔÀµ¤Ê¥á¥â¥ê¥¢¥¯¥»¥¹)
480 SIGPOLL Term ¥Ý¡¼¥ê¥ó¥°²Äǽ¤Ê¥¤¥Ù¥ó¥È (Sys V)¡£
482 SIGPROF 27,27,29 Term profiling ¥¿¥¤¥Þ¤Î»þ´ÖÀÚ¤ì
483 .\"O SIGSYS 12,31,12 Core Bad argument to routine (SVr4)
484 .\"O SIGTRAP 5 Core Trace/breakpoint trap
485 .\"O SIGURG 16,23,21 Ign Urgent condition on socket (4.2BSD)
486 SIGSYS 12,31,12 Core ¥ë¡¼¥Á¥ó¤Ø¤Î°ú¤¿ô¤¬ÉÔÀµ (SVr4)
487 SIGTRAP 5 Core ¥È¥ì¡¼¥¹/¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È ¥È¥é¥Ã¥×
488 SIGURG 16,23,21 Ign T{
489 ¥½¥±¥Ã¥È¤Î¶ÛµÞ»öÂÖ (urgent condition) (4.2BSD)
491 .\"O SIGVTALRM 26,26,28 Term Virtual alarm clock (4.2BSD)
492 .\"O SIGXCPU 24,24,30 Core CPU time limit exceeded (4.2BSD)
493 .\"O SIGXFSZ 25,25,31 Core File size limit exceeded (4.2BSD)
494 SIGVTALRM 26,26,28 Term ²¾ÁÛ¥¢¥é¡¼¥à¥¯¥í¥Ã¥¯ (4.2BSD)
495 SIGXCPU 24,24,30 Core CPU»þ´ÖÀ©¸ÂĶ²á (4.2BSD)
496 SIGXFSZ 25,25,31 Core ¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ÎĶ²á (4.2BSD)
499 .\"O Up to and including Linux 2.2, the default behavior for
500 .\"O .BR SIGSYS ", " SIGXCPU ", " SIGXFSZ ", "
501 .\"O and (on architectures other than SPARC and MIPS)
503 .\"O was to terminate the process (without a core dump).
504 .\"O (On some other UNIX systems the default action for
505 .\"O .BR SIGXCPU " and " SIGXFSZ
506 .\"O is to terminate the process without a core dump.)
507 .\"O Linux 2.4 conforms to the POSIX.1-2001 requirements for these signals,
508 .\"O terminating the process with a core dump.
510 .BR SIGSYS ", " SIGXCPU ", " SIGXFSZ
511 ¤ª¤è¤Ó SPARC ¤È MIPS °Ê³°¤Î¥¢¡¼¥¥Æ¥¯¥Á¥ã¤Ç¤Î
513 ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ï (¥³¥¢¥À¥ó¥×½ÐÎϤʤ·¤Î) ¥×¥í¥»¥¹½ªÎ»¤Ç¤¢¤Ã¤¿¡£
514 (¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ë¤â
515 .BR SIGXCPU " ¤È " SIGXFSZ
516 ¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¥³¥¢¥À¥ó¥×¤Ê¤·¤Î¥×¥í¥»¥¹½ªÎ»¤Î¤â¤Î¤¬¤¢¤ë¡£)
517 Linux 2.4 ¤Ç¤Ï¡¢POSIX.1-2001 ¤Ç¤ÎÍ×µá»ÅÍͤ˽àµò¤·¤Æ¡¢
518 ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ç¡¢¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¡¢¥³¥¢¥À¥ó¥×¤ò½ÐÎϤ¹¤ë
521 .\"O Next various other signals.
522 ¼¡¤Ë¤½¤Î¾¤Î³Æ¼ï¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
527 .\"O Signal Value Action Comment
528 ¥·¥°¥Ê¥ë ÃÍ Æ°ºî ¥³¥á¥ó¥È
529 .\"O SIGIOT 6 Core IOT trap. A synonym for \fBSIGABRT\fP
530 .\"O SIGEMT 7,\-,7 Term
531 .\"O SIGSTKFLT \-,16,\- Term Stack fault on coprocessor (unused)
532 .\"O SIGIO 23,29,22 Term I/O now possible (4.2BSD)
533 .\"O SIGCLD \-,\-,18 Ign A synonym for \fBSIGCHLD\fP
534 SIGIOT 6 Core IOT ¥È¥é¥Ã¥×¡£\fBSIGABRT\fP ¤ÈƱµÁ
536 SIGSTKFLT \-,16,\- A T{
537 ¿ôÃͱ黻¥×¥í¥»¥Ã¥µ¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¥Õ¥©¥ë¥È (̤»ÈÍÑ)
539 SIGIO 23,29,22 Term Æþ½ÐÎϤ¬²Äǽ¤Ë¤Ê¤Ã¤¿ (4.2BSD)
540 SIGCLD \-,\-,18 Ign \fBSIGCHLD\fP ¤ÈƱµÁ
541 .\"O SIGPWR 29,30,19 Term Power failure (System V)
542 .\"O SIGINFO 29,\-,\- A synonym for \fBSIGPWR\fP
543 .\"O SIGLOST \-,\-,\- Term File lock lost
544 .\"O SIGWINCH 28,28,20 Ign Window resize signal (4.3BSD, Sun)
545 .\"O SIGUNUSED \-,31,\- Core Synonymous with \fBSIGSYS\fP
546 SIGPWR 29,30,19 Term ÅŸ»ÁÓ¼º (Power failure) (System V)
547 SIGINFO 29,\-,\- \fBSIGPWR\fP ¤ÈƱµÁ
548 SIGLOST \-,\-,\- Term ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤¬¼º¤ï¤ì¤¿
549 SIGWINCH 28,28,20 Ign T{
550 ¥¦¥£¥ó¥É¥¦ ¥ê¥µ¥¤¥º ¥·¥°¥Ê¥ë (4.3BSD, Sun)
552 SIGUNUSED \-,31,\- Core \fBSIGSYS\fP ¤ÈƱµÁ
562 (¥·¥°¥Ê¥ë 29 ¤Ï alpha ¤Ç¤Ï
571 .\"O is not specified in POSIX.1-2001, but nevertheless appears
572 .\"O on most other UNIX systems,
573 .\"O where its default action is typically to terminate
574 .\"O the process with a core dump.
576 ¤Ï POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢
577 ¤½¤Î¾¤Î¿¤¯¤Î UNIX ¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£
578 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¿¤¯¤Î¾ì¹ç¡¢¥³¥¢¥À¥ó¥×½ÐÎϤòȼ¤¦¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
581 .\"O (which is not specified in POSIX.1-2001) is typically ignored
582 .\"O by default on those other UNIX systems where it appears.
584 ¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤³¤Î¥·¥°¥Ê¥ë¤¬Â¸ºß¤¹¤ë
585 ¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£
588 .\"O (which is not specified in POSIX.1-2001) is ignored by default
589 .\"O on several other UNIX systems.
591 ¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï
592 ¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£
596 .\"O is synonymous with
597 .\"O .\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
599 .\"O on most architectures.
601 ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¥¢¡¼¥¥Æ¥¯¥Á¥ã¤Ç
603 ¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
604 .\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
605 .\"O .SS "Real-time Signals"
606 .SS ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë
607 .\"O Linux supports real-time signals as originally defined in the POSIX.1b
608 .\"O real-time extensions (and now included in POSIX.1-2001).
609 Linux ¤Ï¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
610 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï¸µ¡¹ POSIX.1b ¤Î¥ê¥¢¥ë¥¿¥¤¥à³ÈÄ¥¤ÇÄêµÁ¤µ¤ì¤Æ
611 ¤¤¤ë¤â¤Î¤Ç¤¢¤ê¡¢¸½ºß¤Ç¤Ï POSIX.1-2001 ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
612 .\"O The range of supported real-time signals is defined by the macros
616 .\"O POSIX.1-2001 requires that an implementation support at least
617 .\"O .B _POSIX_RTSIG_MAX
618 .\"O (8) real-time signals.
619 Âбþ¤·¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈϰϤϡ¢¥Þ¥¯¥í
624 POSIX.1-2001 ¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â
626 (8) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤¿¼ÂÁõ¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£
628 .\"O The Linux kernel supports a range of 32 different real-time
629 .\"O signals, numbered 33 to 64.
630 .\"O However, the glibc POSIX threads implementation internally uses
631 .\"O two (for NPTL) or three (for LinuxThreads) real-time signals
633 .\"O .BR pthreads (7)),
634 .\"O and adjusts the value of
636 .\"O suitably (to 34 or 35).
637 Linux ¤Ï¡¢32 ¸Ä¤Î°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤ª¤ê¡¢
638 ¤½¤ÎÈÖ¹æ¤Ï 33 ¤«¤é 64 ¤Ç¤¢¤ë¡£
639 ¤·¤«¤·¤Ê¤¬¤é¡¢glibc ¤Î POSIX ¥¹¥ì¥Ã¥É¼ÂÁõ¤Ï¡¢
640 ÆâÉô¤Ç 2¸Ä (NPTL ¤Î¾ì¹ç) ¤« 3¸Ä (LinuxThreads ¤Î¾ì¹ç) ¤Î
641 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤ª¤ê
645 ¤ÎÃͤòŬÀÚ¤Ë (34 ¤« 35 ¤Ë) Ä´À°¤¹¤ë¡£
646 .\"O Because the range of available real-time signals varies according
647 .\"O to the glibc threading implementation (and this variation can occur
648 .\"O at run time according to the available kernel and glibc),
649 .\"O and indeed the range of real-time signals varies across UNIX systems,
651 .\"O .IR "never refer to real-time signals using hard-coded numbers" ,
652 .\"O but instead should always refer to real-time signals using the notation
653 .\"O .BR SIGRTMIN +n,
654 .\"O and include suitable (run-time) checks that
658 ÍøÍѲÄǽ¤Ê¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÏ°Ï¤Ï glibc ¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤Ë¤è¤ê
659 °Û¤Ê¤ë¤· (»ÈÍѤ¹¤ë¥«¡¼¥Í¥ë¤È glibc ¤Ë¤è¤ê¼Â¹Ô»þ¤Ë¤âÊѲ½¤¹¤ë)¡¢
660 UNIX ¥·¥¹¥Æ¥à¤Î¼ïÎà¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢
661 ¥×¥í¥°¥é¥à¤Ç¤Ï¡Ö¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤·¤¿¿ô»ú¤ò»È¤Ã¤Æ¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î
662 »²¾È¤Ï·è¤·¤Æ¤¹¤Ù¤¤Ç¤Ï¤Ê¤¯¡×¡¢Âå¤ï¤ê¤Ë
664 ¤Î·Á¤Ç»²¾È¤¹¤Ù¤¤Ç¤¢¤ë¡£¤Þ¤¿¡¢
668 ¤òĶ¤¨¤Æ¤¤¤Ê¤¤¤«¤Î¥Á¥§¥Ã¥¯¤ò (¼Â¹Ô»þ¤Ë) ŬÀڤ˹Ԥ¦¤Ù¤¤Ç¤¢¤ë¡£
670 .\"O Unlike standard signals, real-time signals have no predefined meanings:
671 .\"O the entire set of real-time signals can be used for application-defined
673 ɸ½à¥·¥°¥Ê¥ë¤È°Û¤Ê¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë¤Ï
674 »öÁ°¤ËÄêµÁ¤µ¤ì¤¿°ÕÌ£¤Ï¤Ê¤¤¡£
675 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÁ´Éô¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿ÍÑÅӤ˻Ȥ¨¤ë¡£
677 .\"O The default action for an unhandled real-time signal is to terminate the
678 .\"O receiving process.
679 ¥Ï¥ó¥É¥ê¥ó¥°¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï
680 ¼õ¿®¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
682 .\"O Real-time signals are distinguished by the following:
683 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï°Ê²¼¤ÎÆÃħ¤¬¤¢¤ë:
685 .\"O Multiple instances of real-time signals can be queued.
686 .\"O By contrast, if multiple instances of a standard signal are delivered
687 .\"O while that signal is currently blocked, then only one instance is queued.
688 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÊ£¿ô¤Î¼ÂÂΤò¥¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤¤ë¡£
689 °ìÊý¡¢É¸½à¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë
690 Ʊ¤¸¥·¥°¥Ê¥ë¤ÎÊ£¿ô¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ÇÛÁ÷¤µ¤ì¤Æ¤â¡¢
691 1 ¤Ä¤À¤±¤¬¥¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£
693 .\"O If the signal is sent using
694 .\"O .BR sigqueue (3),
695 .\"O an accompanying value (either an integer or a pointer) can be sent
696 .\"O with the signal.
699 ¤òÍѤ¤¤ÆÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢
700 ÉÕ°¥Ç¡¼¥¿ (À°¿ô¤«¥Ý¥¤¥ó¥¿) ¤ò¥·¥°¥Ê¥ë¤È¶¦¤ËÁ÷¿®¤Ç¤¤ë¡£
701 .\"O If the receiving process establishes a handler for this signal using the
704 .\"O .BR sigaction (2)
705 .\"O then it can obtain this data via the
709 .\"O structure passed as the second argument to the handler.
714 ¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¾ì¹ç¡¢
719 ¥Õ¥£¡¼¥ë¥É·Ðͳ¤Ç¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤¿ô¤È¤·¤ÆÅϤµ¤ì¡¢
720 ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
721 .\"O Furthermore, the
725 .\"O fields of this structure can be used to obtain the PID
726 .\"O and real user ID of the process sending the signal.
731 ¥Õ¥£¡¼¥ë¥É¤Ç¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤È¼Â¥æ¡¼¥¶ ID ¤ò
734 .\"O Real-time signals are delivered in a guaranteed order.
735 .\"O Multiple real-time signals of the same type are delivered in the order
737 .\"O If different real-time signals are sent to a process, they are delivered
738 .\"O starting with the lowest-numbered signal.
739 .\"O (I.e., low-numbered signals have highest priority.)
740 .\"O By contrast, if multiple standard signals are pending for a process,
741 .\"O the order in which they are delivered is unspecified.
742 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ç¤ÏÇÛÁ÷¤µ¤ì¤ë½ç½ø¤¬Êݾڤµ¤ì¤ë¡£
743 Ʊ¤¸¥¿¥¤¥×¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÁ÷¿®¤µ¤ì¤¿½çÈÖ¤ËÅþÃ夹¤ë¡£
744 °Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢
745 ÈÖ¹æ¤Î¾®¤µ¤¤¥·¥°¥Ê¥ë¤«¤éÀè¤ËÅþÃ夹¤ë¡£
746 (¤Ä¤Þ¤ê¾®¤µ¤¤ÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤¬¹â¤¤Í¥Àè½ç°Ì¤ò»ý¤Ä¡£)
747 ÂоÈŪ¤Ë¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÊ£¿ô¤Îɸ½à¥·¥°¥Ê¥ë¤¬½èÍýÂÔ¤Á¤È¤Ê¤Ã¤¿¾ì¹ç¡¢
748 ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë½ç½ø¤ÏÉÔÄê¤Ç¤¢¤ë¡£
750 .\"O If both standard and real-time signals are pending for a process,
751 .\"O POSIX leaves it unspecified which is delivered first.
752 .\"O Linux, like many other implementations, gives priority
753 .\"O to standard signals in this case.
754 °ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤¬
755 ½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢POSIX ¤Ï¤É¤Á¤é¤¬Àè¤ËÇÛÁ÷¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£
756 Linux ¤Ç¤Ï¡¢Â¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍÍ¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï
757 ɸ½à¥·¥°¥Ê¥ë¤¬Í¥À褵¤ì¤ë¡£
759 .\"O According to POSIX, an implementation should permit at least
760 .\"O .B _POSIX_SIGQUEUE_MAX
761 .\"O (32) real-time signals to be queued to
763 POSIX ¤Ë¤è¤ì¤Ð¡¢1 ¥×¥í¥»¥¹Ëè¤ËºÇÄã
764 .B _POSIX_SIGQUEUE_MAX
765 (32) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¤Ù¤¤È¤·¤Æ¤¤¤ë¡£
766 .\"O However, Linux does things differently.
767 .\"O In kernels up to and including 2.6.7, Linux imposes
768 .\"O a system-wide limit on the number of queued real-time signals
769 .\"O for all processes.
770 ¤·¤«¤·¡¢ Linux ¤Ç¤Ï°ã¤Ã¤¿¼ÂÁõ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥«¡¼¥Í¥ë 2.6.7 ¤Þ¤Ç¤Ï
771 (2.6.7 ¤ò´Þ¤à)¡¢Á´¥×¥í¥»¥¹¤Ç¥¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë
772 ¤Î¿ô¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤¬¤¢¤ë¡£
773 .\"O This limit can be viewed and (with privilege) changed via the
774 .\"O .I /proc/sys/kernel/rtsig-max
777 .\"O .IR /proc/sys/kernel/rtsig-nr ,
778 .\"O can be used to find out how many real-time signals are currently queued.
780 .I /proc/sys/kernel/rtsig-max
781 ¥Õ¥¡¥¤¥ë¤Ç¸«¤ë¤³¤È¤¬¤Ç¤¡¢ (¸¢¸Â¤¬¤¢¤ì¤Ð) Êѹ¹¤â¤Ç¤¤ë¡£
782 ´Ø·¸¤¹¤ë¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢
783 .I /proc/sys/kernel/rtsig-nr
784 ¤ò¸«¤ë¤³¤È¤Ç¡¢¤¤¤¯¤Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¸½ºß¥¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¤«¤ò
786 .\"O In Linux 2.6.8, these
788 .\"O interfaces were replaced by the
789 .\"O .B RLIMIT_SIGPENDING
790 .\"O resource limit, which specifies a per-user limit for queued
792 .\"O .BR setrlimit (2)
793 .\"O for further details.
794 Linux 2.6.8 ¤Ç¡¢¤³¤ì¤é¤Î
796 ·Ðͳ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢
798 ¥ê¥½¡¼¥¹À©¸Â¤ËÃÖ¤´¹¤¨¤é¤ì¤¿¡£
799 ¤³¤ì¤Ï¡¢¥¥å¡¼¤ËÆþ¤ë¥·¥°¥Ê¥ë¿ô¤Ë´Ø¤·¤Æ¥æ¡¼¥¶Ã±°Ì¤Ë
800 ¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£
804 .\"O .SS "Async-signal-safe functions"
805 .SS "ÈóƱ´ü¥·¥°¥Ê¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô (async-signal-safe functions)"
807 .\"O A signal handler function must be very careful,
808 .\"O since processing elsewhere may be interrupted
809 .\"O at some arbitrary point in the execution of the program.
810 .\"O POSIX has the concept of "safe function".
811 .\"O If a signal interrupts the execution of an unsafe function, and
813 .\"O calls an unsafe function, then the behavior of the program is undefined.
814 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ë¤ÏÈó¾ï¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
815 ¾¤Î¾ì½ê¤Î½èÍý¤Ï¥×¥í¥°¥é¥à¼Â¹Ô¤ÎǤ°Õ¤Î²Õ½ê¤ÇÃæÃǤµ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¤¿¤á¤Ç¤¢¤ë¡£
816 POSIX ¤Ë¤Ï¡Ö°ÂÁ´¤Ê´Ø¿ô (safe function)¡×¤È¤¤¤¦³µÇ°¤¬¤¢¤ë¡£
817 ¥·¥°¥Ê¥ë¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Î¼Â¹Ô¤òÃæÃǤ·¡¢¤«¤Ä
819 ¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢¥×¥í¥°¥é¥à¤ÎµóÆ°¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
821 .\"O POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2)
822 .\"O requires an implementation to guarantee that the following
823 .\"O functions can be safely called inside a signal handler:
824 POSIX.1-2004 (POSIX.1-2001 Technical Corrigendum (Àµ¸íɽ) 2 ¤È¤â¸À¤¦) ¤Ç¤Ï¡¢
825 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤Ç¤Î°ÂÁ´¤Ê¸Æ¤Ó½Ð¤·¤òÊݾڤ¹¤ë¤³¤È¤¬É¬¿Ü¤Î´Ø¿ô¤È¤·¤Æ
826 °Ê²¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
951 .\"O POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf()
952 .\"O from the above list, and adds the following functions:
953 POSIX.1-2008 ¤Ç¤Ï¡¢¾åµ¤Î¥ê¥¹¥È¤Î¤¦¤Á fpathconf(), pathconf(), sysconf()
954 ¤¬ºï½ü¤µ¤ì¡¢°Ê²¼¤Î´Ø¿ô¤¬Äɲ䵤줿¡£
980 .\"O .SS Interruption of System Calls and Library Functions by Signal Handlers
981 .SS ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß
982 .\"O If a signal handler is invoked while a system call or library
983 .\"O function call is blocked, then either:
984 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¤¬Ää»ß (block) ¤·¤Æ¤¤¤ë´Ö¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬
985 µ¯Æ°¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤É¤Á¤é¤«¤È¤Ê¤ë¡£
987 .\"O the call is automatically restarted after the signal handler returns; or
988 ¥·¥°¥Ê¥ë¤¬Ê֤俸塢¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¡£
990 .\"O the call fails with the error
996 .\"O Which of these two behaviors occurs depends on the interface and
997 .\"O whether or not the signal handler was established using the
1000 .\"O .BR sigaction (2)).
1001 .\"O The details vary across UNIX systems;
1002 .\"O below, the details for Linux.
1003 ¤³¤ì¤é¤ÎÆó¤Ä¤ÎµóÆ°¤Î¤¦¤Á¤É¤Á¤é¤¬µ¯¤³¤ë¤«¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤è¤ê°Í¸¤·¡¢
1008 »²¾È) ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤¿¤«¤Ë¤â°Í¸¤¹¤ë¡£
1009 ¾ÜºÙ¤Ï UNIX ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
1010 Linux ¤Ë¤ª¤±¤ë¾ÜºÙ¤ò°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£
1012 .\"O If a blocked call to one of the following interfaces is interrupted
1013 .\"O by a signal handler, then the call will be automatically restarted
1014 .\"O after the signal handler returns if the
1016 .\"O flag was used; otherwise the call will fail with the error
1018 .\"O .\" The following system calls use ERESTARTSYS,
1019 .\"O .\" so that they are restartable
1020 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë
1021 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢
1023 ¥Õ¥é¥°¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë
1024 ¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
1025 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼
1027 ¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
1028 .\" °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ERESTARTSYS ¤ò»È¤Ã¤Æ¤¤¤ë¡£
1029 .\" ¤½¤Î¤¿¤á¡¢¤³¤ì¤é¤ÏºÆ¥¹¥¿¡¼¥È¤¬²Äǽ¤Ç¤¢¤ë¡£
1035 .\"O .BR writev (2),
1038 .\"O calls on "slow" devices.
1039 .\"O A "slow" device is one where the I/O call may block for an
1040 .\"O indefinite time, for example, a terminal, pipe, or socket.
1041 .\"O (A disk is not a slow device according to this definition.)
1042 .\"O If an I/O call on a slow device has already transferred some
1043 .\"O data by the time it is interrupted by a signal handler,
1044 .\"O then the call will return a success status
1045 .\"O (normally, the number of bytes transferred).
1051 ¤Î¡ÖÃÙ¤¤ (slow)¡×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¸Æ¤Ó½Ð¤·¡£
1052 ¤³¤³¤Ç¤¤¤¦¡ÖÃÙ¤¤¡×¥Ç¥Ð¥¤¥¹¤È¤Ï¡¢I/O ¸Æ¤Ó½Ð¤·¤¬Ìµ´ü¸Â¤ËÄä»ß (block) ¤¹¤ë
1053 ²ÄǽÀ¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î¤³¤È¤Ç¡¢Îã¤È¤·¤Æ¤ÏüËö¡¢¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¤¬¤¢¤ë
1054 (¤³¤ÎÄêµÁ¤Ç¤Ï¡¢¥Ç¥£¥¹¥¯¤ÏÃÙ¤¤¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤)¡£
1055 ÃÙ¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë I/O ¸Æ¤Ó½Ð¤·¤¬¡¢
1056 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿»þÅÀ¤Þ¤Ç¤Ë²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò
1057 ¤¹¤Ç¤ËžÁ÷¤·¤Æ¤¤¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¤ÏÀ®¸ù¥¹¥Æ¡¼¥¿¥¹
1058 (Ä̾ï¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ð¥¤¥È¿ô) ¤òÊÖ¤¹¤³¤È¤À¤í¤¦¡£
1061 .\"O if it can block (e.g., when opening a FIFO; see
1063 Ää»ß (block) ¤¹¤ë²ÄǽÀ¤Î¤¢¤ë
1065 (Î㤨¤Ð¡¢FIFO ¤Î¥ª¡¼¥×¥ó»þ;
1072 .\"O .BR waitid (2),
1074 .\"O .BR waitpid (2).
1081 .\"O Socket interfaces:
1082 ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1083 .\" If a timeout (setsockopt()) is in effect on the socket, then these
1084 .\" system calls switch to using EINTR. Consequently, they and are not
1085 .\" automatically restarted, and they show the stop/cont behavior
1086 .\" described below. (Verified from 2.6.26 source, and by experiment; mtk)
1087 .\"O .BR accept (2),
1088 .\"O .BR connect (2),
1090 .\"O .BR recvfrom (2),
1091 .\"O .BR recvmsg (2),
1093 .\"O .BR sendto (2),
1095 .\"O .BR sendmsg (2),
1096 .\"O unless a timeout has been set on the socket (see below).
1105 ⤷¡¢¥½¥±¥Ã¥È¤Ë¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç (²¼µ»²¾È)¡£
1107 .\"O File locking interfaces:
1108 ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ÍÑ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1117 .\"O POSIX message queue interfaces:
1118 POSIX ¥á¥Ã¥»¡¼¥¸¥¥å¡¼¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1120 .BR mq_timedreceive (3),
1123 .BR mq_timedsend (3).
1127 .\"O (since Linux 2.6.22; beforehand, always failed with
1129 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1133 .\"O POSIX semaphore interfaces:
1134 POSIX ¥»¥Þ¥Õ¥©¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1135 .\"O .BR sem_wait (3)
1137 .\"O .BR sem_timedwait (3)
1138 .\"O (since Linux 2.6.22; beforehand, always failed with
1141 .BR sem_timedwait (3)
1142 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1147 .\"O The following interfaces are never restarted after
1148 .\"O being interrupted by a signal handler,
1149 .\"O regardless of the use of
1150 .\"O .BR SA_RESTART ;
1151 .\"O they always fail with the error
1153 .\"O when interrupted by a signal handler:
1154 .\"O .\" These are the system calls that give EINTR or ERESTARTNOHAND
1155 .\"O .\" on interruption by a signal handler.
1156 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1158 ¤ò»È¤Ã¤Æ¤¤¤ë¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢
1159 ºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£
1160 ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¾ï¤Ë¥¨¥é¡¼
1163 .\" ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë³ä¤ê¹þ¤ß¤ÎºÝ¤Ë
1164 .\" EINTR ¤« ERESTARTNOHAND ¤òÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£
1167 .\"O Socket interfaces, when a timeout has been set on the socket using
1168 .\"O .BR setsockopt (2):
1169 .\"O .BR accept (2),
1171 .\"O .BR recvfrom (2),
1173 .\"O .BR recvmsg (2),
1174 .\"O if a receive timeout
1175 .\"O .RB ( SO_RCVTIMEO )
1177 .\"O .BR connect (2),
1179 .\"O .BR sendto (2),
1181 .\"O .BR sendmsg (2),
1182 .\"O if a send timeout
1183 .\"O .RB ( SO_SNDTIMEO )
1186 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1193 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1200 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1202 .\"O Interfaces used to wait for signals:
1203 ¥·¥°¥Ê¥ëÂÔ¤Á¤Ë»È¤ï¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1206 .BR sigtimedwait (2),
1208 .BR sigwaitinfo (2).
1210 .\"O File descriptor multiplexing interfaces:
1211 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1213 .BR epoll_pwait (2),
1220 .\"O System V IPC interfaces:
1221 System V IPC ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1222 .\" On some other systems, SA_RESTART does restart these system calls
1229 .\"O Sleep interfaces:
1230 ¥¹¥ê¡¼¥×ÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1231 .BR clock_nanosleep (2),
1238 .\"O .BR inotify (7)
1239 .\"O file descriptor.
1241 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1244 .BR io_getevents (2).
1249 .\"O function is also never restarted if interrupted by a handler,
1250 .\"O but gives a success return: the number of seconds remaining to sleep.
1252 ´Ø¿ô¤â¡¢¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢·è¤·¤ÆºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£
1253 ¤·¤«¤·¡¢À®¸ù¤È¤Ê¤ê¡¢»Ä¤Ã¤Æ¤¤¤ëÄä»ß»þ´Ö¤òÊÖ¤¹¡£
1254 .\"O .SS Interruption of System Calls and Library Functions by Stop Signals
1255 .SS °ì»þÄä»ß¥·¥°¥Ê¥ë¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß
1256 .\"O On Linux, even in the absence of signal handlers,
1257 .\"O certain blocking interfaces can fail with the error
1259 .\"O after the process is stopped by one of the stop signals
1260 .\"O and then resumed via
1262 .\"O This behavior is not sanctioned by POSIX.1, and doesn't occur
1263 .\"O on other systems.
1264 Linux ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
1265 ¤¤¤¯¤Ä¤«¤Î¥Ö¥í¥Ã¥¥ó¥°·¿¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1266 ¥×¥í¥»¥¹¤¬°ì»þÄä»ß (stop) ¥·¥°¥Ê¥ë¤Î°ì¤Ä¤Ë¤è¤êÄä»ß¤µ¤ì¡¢
1268 ¤Ë¤è¤êºÆ³«¤µ¤ì¤¿¸å¤Ë¡¢¥¨¥é¡¼
1270 ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
1271 ¤³¤ÎµóÆ°¤Ï POSIX.1 ¤Çǧ¤á¤é¤ì¤Æ¤ª¤é¤º¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ïµ¯¤³¤é¤Ê¤¤¡£
1273 .\"O The Linux interfaces that display this behavior are:
1274 ¤³¤ÎµóÆ°¤ò¼¨¤¹ Linux ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
1277 .\"O Socket interfaces, when a timeout has been set on the socket using
1278 .\"O .BR setsockopt (2):
1279 .\"O .BR accept (2),
1281 .\"O .BR recvfrom (2),
1283 .\"O .BR recvmsg (2),
1284 .\"O if a receive timeout
1285 .\"O .RB ( SO_RCVTIMEO )
1287 .\"O .BR connect (2),
1289 .\"O .BR sendto (2),
1291 .\"O .BR sendmsg (2),
1292 .\"O if a send timeout
1293 .\"O .RB ( SO_SNDTIMEO )
1296 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1303 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1310 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1313 .BR epoll_pwait (2).
1318 .BR sigtimedwait (2),
1319 .BR sigwaitinfo (2).
1323 .\"O .BR inotify (7)
1324 .\"O file descriptor.
1326 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1329 .\"O Linux 2.6.21 and earlier:
1333 .BR sem_timedwait (3),
1336 .\"O Linux 2.6.8 and earlier:
1341 .\"O Linux 2.4 and earlier:
1345 .\"O .SH "CONFORMING TO"
1347 .\"O POSIX.1, except as noted.
1348 POSIX.1 (Ãíµ¤·¤¿ÆâÍưʳ°)¡£
1354 .\"O have the same value.
1355 .\"O The latter is commented out in the kernel source, but
1356 .\"O the build process of some software still thinks that
1362 ¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤¤¤ë¡£
1364 ¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤Ç¤Ï¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¡£
1365 ¤·¤«¤·¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤Æ¤Ï¥Ó¥ë¥É¤Î²áÄø¤Ç¥·¥°¥Ê¥ë 29 ¤ò
1367 ¤È¤ß¤Ê¤·¤Æ¤·¤Þ¤¦¤â¤Î¤¬¤¢¤ë¡£
1374 .BR rt_sigqueueinfo (2),
1379 .BR sigaltstack (2),
1383 .BR sigprocmask (2),
1385 .BR sigwaitinfo (2),
1390 .BR pthread_sigqueue (3),
1397 .BR sysv_signal (3),