OSDN Git Service

b1cb5b6914d887c588a370e2a99dcef2e09072ed
[linuxjm/LDP_man-pages.git] / draft / man7 / signal.7
1 '\" t
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>
6 .\"
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.
10 .\"
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.
15 .\"
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
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\"
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.
39 .\" 2008-07-04, mtk:
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
43 .\"
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
59 .\"
60 .\"WORD:        disposition     ½èÍýÊýË¡
61 .\"WORD:        pending         ½èÍýÂÔ¤Á
62 .\"WORD:        signal handler  ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é
63 .\"
64 .TH SIGNAL 7  2010-09-19 "Linux" "Linux Programmer's Manual"
65 .\"O .SH NAME
66 .\"O signal \- overview of signals
67 .SH Ì¾Á°
68 signal \- ¥·¥°¥Ê¥ë¤Î³µÍ×
69 .\"O .SH DESCRIPTION
70 .SH ÀâÌÀ
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"
76 .SS ¥·¥°¥Ê¥ë½èÍýÊýË¡
77 .\"O Each signal has a current
78 .\"O .IR disposition ,
79 .\"O which determines how the process behaves when it is delivered
80 .\"O the signal.
81 ¥·¥°¥Ê¥ë¤Ï¤½¤ì¤¾¤ì¸½ºß¤Î¡Ö½èÍýÊýË¡ (disposition)¡×¤òÊÝ»ý¤·¤Æ¤ª¤ê¡¢
82 ¤³¤Î½èÍýÊýË¡¤Ë¤è¤ê¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿ºÝ¤Ë¥×¥í¥»¥¹¤¬
83 ¤É¤Î¤è¤¦¤Ê¿¶Éñ¤¤¤ò¤¹¤ë¤«¤¬·è¤Þ¤ë¡£
84
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 ½èÍýÊýË¡¤ò¼¨¤·¤Æ¤ª¤ê¡¢°Ê²¼¤Î¤è¤¦¤Ê°ÕÌ£¤ò»ý¤Ä¡£
89 .IP Term
90 .\"O Default action is to terminate the process.
91 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¡£
92 .IP Ign
93 .\"O Default action is to ignore the signal.
94 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¤³¤Î¥·¥°¥Ê¥ë¤Î̵»ë¡£
95 .IP Core
96 .\"O Default action is to terminate the process and dump core (see
97 .\"O .BR core (5)).
98 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹½ªÎ»¤È¥³¥¢¥À¥ó¥×½ÐÎÏ
99 .RB ( core (5)
100 »²¾È)¡£
101 .IP Stop
102 .\"O Default action is to stop the process.
103 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¥×¥í¥»¥¹¤Î°ì»þÄä»ß¡£
104 .IP Cont
105 .\"O Default action is to continue the process if it is currently stopped.
106 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤¬Ää»ßÃæ¤Î¾ì¹ç¤Ë¤½¤Î¼Â¹Ô¤ÎºÆ³«¡£
107 .PP
108 .\"O A process can change the disposition of a signal using
109 .\"O .BR sigaction (2)
110 .\"O or
111 .\"O .BR signal (2).
112 .\"O (The latter is less portable when establishing a signal handler;
113 .\"O see
114 .\"O .BR signal (2)
115 .\"O for details.)
116 ¥×¥í¥»¥¹¤Ï¡¢
117 .BR sigaction (2)
118 ¤ä
119 .BR signal (2)
120 ¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë
121 .RB ( signal (2)
122 ¤ÎÊý¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤹ¤ëºÝ¤Î°Ü¿¢À­¤¬Ä㤤;
123 ¾ÜºÙ¤Ï
124 .BR signal (2)
125 ¤ò»²¾È)¡£
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 ÂåÂØ¥¹¥¿¥Ã¥¯¤¬Ìò¤ËΩ¤Ä¤«¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ë¤Ä¤¤¤Æ¤Ï
149 .BR sigaltstack (2)
150 ¤ò»²¾È¤Î¤³¤È¡£
151
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 Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÇƱ¤¸¤Ç¤¢¤ë¡£
158
159 .\"O A child created via
160 .\"O .BR fork (2)
161 .\"O inherits a copy of its parent's signal dispositions.
162 .\"O During an
163 .\"O .BR execve (2),
164 .\"O the dispositions of handled signals are reset to the default;
165 .\"O the dispositions of ignored signals are left unchanged.
166 .BR fork (2)
167 ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£
168 .BR execve (2)
169 ¤Î´Ö¡¢¥Ï¥ó¥É¥é¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È
170 ¤µ¤ì¡¢Ìµ»ë¤È¤Ê¤Ã¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ÏÊѹ¹¤µ¤ì¤º¤½¤Î¤Þ¤Þ¤È¤Ê¤ë¡£
171 .\"O .SS Sending a Signal
172 .SS ¥·¥°¥Ê¥ë¤ÎÁ÷¿®
173 .\"O The following system calls and library functions allow
174 .\"O the caller to send a signal:
175 °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¥é¥¤¥Ö¥é¥ê´Ø¿ô¤ò»È¤Ã¤Æ¡¢
176 ¸Æ¤Ó½Ð¤·¼Ô¤Ï¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
177 .TP 16
178 .BR raise (3)
179 .\"O Sends a signal to the calling thread.
180 ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
181 .TP
182 .BR kill (2)
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 ¥·¥¹¥Æ¥à¤ÎÁ´¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
188 .TP
189 .BR killpg (2)
190 .\"O Sends a signal to all of the members of a specified process group.
191 »ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
192 .TP
193 .BR pthread_kill (3)
194 .\"O Sends a signal to a specified POSIX thread in the same process as
195 .\"O the caller.
196 ¸Æ¤Ó½Ð¤·¼Ô¤ÈƱ¤¸¥×¥í¥»¥¹Æâ¤Î»ØÄꤵ¤ì¤¿ POSIX ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
197 .TP
198 .BR tgkill (2)
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 (¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ
204 .BR pthread_kill (3)
205 ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë)¡£
206 .TP
207 .BR sigqueue (2)
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 ¾ì¹ç¤Ë¤â¼Â¹Ô¤ÎÄä»ß¤Ï½ªÎ»¤¹¤ë)¡£
219 .TP 16
220 .BR pause (2)
221 .\"O Suspends execution until any signal is caught.
222 ²¿¤«¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÄä»ß¤¹¤ë¡£
223 .TP
224 .BR sigsuspend (2)
225 .\"O Temporarily changes the signal mask (see below) and suspends
226 .\"O execution until one of the unmasked signals is caught.
227 °ì»þŪ¤Ë¥·¥°¥Ê¥ë¥Þ¥¹¥¯ (²¼µ­»²¾È) ¤òÊѹ¹¤·¡¢
228 ¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤Î¤¤¤º¤ì¤«¤¬Ê᪤µ¤ì¤ë¤Þ¤Ç
229 ¼Â¹Ô¤òÃæÃǤ¹¤ë¡£
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 ¤³¤ì¤ò¹Ô¤¦°ìÈÌŪ¤ÊÊýË¡¤¬Æó¤Ä¤¢¤ë¡£
244 .IP * 2
245 .\"O .BR sigwaitinfo (2),
246 .\"O .BR sigtimedwait (2),
247 .\"O and
248 .\"O .BR sigwait (3)
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.
252 .BR sigwaitinfo (2),
253 .BR sigtimedwait (2),
254 .BR sigwait (3)
255 ¤Ï¡¢»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¼Â¹Ô¤òÃæÃǤ¹¤ë¡£
256 ¤É¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä´Ø¿ô¤Ç¤â¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£
257 .IP *
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.
261 .\"O Each
262 .\"O .BR read (2)
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
268 .\"O .BR read (2)
269 .\"O contains a structure describing the signal.
270 .BR signalfd (2)
271 ¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò»È¤¦¤È¡¢¸Æ¤Ó½Ð¤·¸µ¤ËÇÛÁ÷¤µ¤ì¤¿
272 ¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤ë¡£
273 ¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
274 .BR read (2)
275 ¤Ï¡¢
276 .BR signalfd (2)
277 ¤Î¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿¥·¥°¥Ê¥ë½¸¹ç¤Î¥·¥°¥Ê¥ë¤Î°ì¤Ä¤¬¸Æ¤Ó½Ð¤·¸µ¤Ë
278 ÇÛÁ÷¤µ¤ì¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£
279 .BR read (2)
280 ¤¬ÊÖ¤¹¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¥·¥°¥Ê¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò³ÊǼ¤·¤¿¹½Â¤ÂΤ¬Æþ¤Ã¤Æ¤¤¤ë¡£
281 .\"O .SS "Signal Mask and Pending Signals"
282 .SS ¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë
283 .\"O A signal may be
284 .\"O .IR blocked ,
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
288 .\"O .IR pending .
289 ¥·¥°¥Ê¥ë¤Ï
290 .I "¥Ö¥í¥Ã¥¯ (block)"
291 ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£¥Ö¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï
292 ¤½¤Î¸å¥Ö¥í¥Ã¥¯¤ò²ò½ü¤µ¤ì¤ë¤Þ¤ÇÇÛÁ÷¤µ¤ì¤Ê¤¯¤Ê¤ë¡£
293 ¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤Æ¤«¤éÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¡¢¤½¤Î¥·¥°¥Ê¥ë¤Ï
294 .I "½èÍýÂÔ¤Á (pending)"
295 ¤Ç¤¢¤ë¤È¸Æ¤Ð¤ì¤ë¡£
296
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 ¥·¥°¥Ê¥ë½¸¹ç¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë¡£
309 ¥¹¥ì¥Ã¥É¤Ï¡¢
310 .BR pthread_sigmask (3)
311 ¤ò»È¤Ã¤Æ¼«Ê¬¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£
312 ÅÁÅýŪ¤Ê¥·¥ó¥°¥ë¥¹¥ì¥Ã¥É¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
313 .BR sigprocmask (2)
314 ¤ò»È¤Ã¤Æ¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤òÁàºî¤Ç¤­¤ë¡£
315
316 .\"O A child created via
317 .\"O .BR fork (2)
318 .\"O inherits a copy of its parent's signal mask;
319 .\"O the signal mask is preserved across
320 .\"O .BR execve (2).
321 .BR fork (2)
322 ·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢
323 ¿Æ¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£
324 .BR execve (2)
325 ¤ÎÁ°¸å¤Ç¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÏÊÝ»ý¤µ¤ì¤ë¡£
326
327 .\"O A signal may be generated (and thus pending)
328 .\"O for a process as a whole (e.g., when sent using
329 .\"O .BR kill (2))
330 .\"O or for a specific thread (e.g., certain signals,
331 .\"O such as
332 .\"O .B SIGSEGV
333 .\"O and
334 .\"O .BR SIGFPE ,
335 .\"O generated as a
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 Î㤨¤Ð¡¢¥×¥í¥»¥¹Á´Âΰ¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï
346 .BR kill (2)
347 ¤ò»È¤Ã¤ÆÁ÷¿®¤µ¤ì¤ë¡£
348 ÆÃÄê¤Î¥Þ¥·¥ó¸ì¤ÎÌ¿Îá¤Î¼Â¹Ô¤Î·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¡¢
349 .B SIGSEGV
350 ¤ä
351 .B SIGFPE
352 ¤Ê¤É¤Î¥·¥°¥Ê¥ë¤Ï¡¢¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£
353 ¤Þ¤¿¡¢
354 .BR pthread_kill (3)
355 ¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É°¸¤Æ¤ËÀ¸À®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤â
356 ¥¹¥ì¥Ã¥É°¸¤Æ¤È¤Ê¤ë¡£
357 ¥×¥í¥»¥¹°¸¤Æ¤Î¥·¥°¥Ê¥ë¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤Î¤¦¤Á
358 ¤¤¤º¤ì¤«¤Î°ì¤Ä¤ËÇÛÁ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤½¤Î¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤
359 ¥¹¥ì¥Ã¥É¤¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢¥·¥°¥Ê¥ë¤òÇÛÁ÷¤¹¤ë¥¹¥ì¥Ã¥É¤Ï¥«¡¼¥Í¥ë¤¬
360 ̵ºî°Ù¤ËÁªÂò¤¹¤ë¡£
361
362 .\"O A thread can obtain the set of signals that it currently has pending
363 .\"O using
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.
368 ¥¹¥ì¥Ã¥É¤Ï¡¢
369 .BR sigpending (2)
370 ¤ò»È¤Ã¤Æ¡¢¸½ºß½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
371 ¤³¤Î½¸¹ç¤Ï¡¢¥×¥í¥»¥¹°¸¤Æ¤Î½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È
372 ¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°¸¤Æ¤Î¥·¥°¥Ê¥ë¤ÎξÊý¤«¤é¹½À®¤µ¤ì¤ë¡£
373
374 .\"O A child created via
375 .\"O .BR fork (2)
376 .\"O initially has an empty pending signal set;
377 .\"O the pending signal set is preserved across an
378 .\"O .BR execve (2).
379 .BR fork (2)
380 ·Ðͳ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¤Ï¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤Ï
381 ¶õ¤Î½¸¹ç¤Ç½é´ü²½¤µ¤ì¤ë¡£
382 .BR execve (2)
383 ¤ÎÁ°¸å¤Ç¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë½¸¹ç¤ÏÊÝ»ý¤µ¤ì¤ë¡£
384 .\"O .SS "Standard Signals"
385 .SS É¸½à¥·¥°¥Ê¥ë
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 \- ¤Ï¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤ÆÂбþ¤¹¤ë¥·¥°¥Ê¥ë¤¬¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£)
400
401 .\"O First the signals described in the original POSIX.1-1990 standard.
402 ºÇ½é¤Ë¡¢POSIX.1-1990 ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
403 .TS
404 l c c l
405 ____
406 lB c c l.
407 .\"O Signal     Value   Action  Comment
408 ¥·¥°¥Ê¥ë        ÃÍ      Æ°ºî    ¥³¥á¥ó¥È
409 .\"O SIGHUP     \01     Term    Hangup detected on controlling terminal
410 .\"O                    or death of controlling process
411 SIGHUP  \01     Term    T{
412 À©¸æüËö(controlling terminal)¤Î¥Ï¥ó¥°¥¢¥Ã¥×¸¡½Ð¡¢
413 ¤Þ¤¿¤ÏÀ©¸æ¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î»à
414 T}
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
429 .\"O                    readers
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 ½ÐÎÏ
452 .TE
453
454 .\"O The signals
455 .\"O .B SIGKILL
456 .\"O and
457 .\"O .B SIGSTOP
458 .\"O cannot be caught, blocked, or ignored.
459 ¥·¥°¥Ê¥ë
460 .B SIGKILL
461 ¤È
462 .B SIGSTOP
463 ¤Ï¥­¥ã¥Ã¥Á¡¢¥Ö¥í¥Ã¥¯¡¢Ìµ»ë¤Ç¤­¤Ê¤¤¡£
464
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 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
469 .TS
470 l c c l
471 ____
472 lB c c l.
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)¡£
481                         \fBSIGIO\fP ¤ÈƱµÁ
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)
490 T}
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)
497 .TE
498
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)
502 .\"O .B SIGBUS
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.
509 Linux 2.2 °ÊÁ°¤Ç¤Ï¡¢
510 .BR SIGSYS ", " SIGXCPU ", " SIGXFSZ
511 ¤ª¤è¤Ó SPARC ¤È MIPS °Ê³°¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Î
512 .B SIGBUS
513 ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¿¶¤ëÉñ¤¤¤Ï (¥³¥¢¥À¥ó¥×½ÐÎϤʤ·¤Î) ¥×¥í¥»¥¹½ªÎ»¤Ç¤¢¤Ã¤¿¡£
514 (¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ë¤â
515 .BR SIGXCPU " ¤È " SIGXFSZ
516 ¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¥³¥¢¥À¥ó¥×¤Ê¤·¤Î¥×¥í¥»¥¹½ªÎ»¤Î¤â¤Î¤¬¤¢¤ë¡£)
517 Linux 2.4 ¤Ç¤Ï¡¢POSIX.1-2001 ¤Ç¤ÎÍ×µá»ÅÍͤ˽àµò¤·¤Æ¡¢
518 ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤Ç¡¢¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¡¢¥³¥¢¥À¥ó¥×¤ò½ÐÎϤ¹¤ë
519 ¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
520
521 .\"O Next various other signals.
522 ¼¡¤Ë¤½¤Î¾¤Î³Æ¼ï¥·¥°¥Ê¥ë¤ò¼¨¤¹¡£
523 .TS
524 l c c l
525 ____
526 lB c c l.
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 ¤ÈƱµÁ
535 SIGEMT  7,\-,7  Term
536 SIGSTKFLT       \-,16,\-        A       T{
537 ¿ôÃͱ黻¥×¥í¥»¥Ã¥µ¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¥Õ¥©¥ë¥È (̤»ÈÍÑ)
538 T}
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)
551 T}
552 SIGUNUSED       \-,31,\-        Core    \fBSIGSYS\fP ¤ÈƱµÁ
553 .TE
554
555 .\"O (Signal 29 is
556 .\"O .B SIGINFO
557 .\"O /
558 .\"O .B SIGPWR
559 .\"O on an alpha but
560 .\"O .B SIGLOST
561 .\"O on a sparc.)
562 (¥·¥°¥Ê¥ë 29 ¤Ï alpha ¤Ç¤Ï
563 .B SIGINFO
564 /
565 .B SIGPWR
566 ¤À¤¬¡¢sparc ¤Ç¤Ï
567 .B SIGLOST
568 ¤Ç¤¢¤ë¡£)
569
570 .\"O .B SIGEMT
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.
575 .B SIGEMT
576 ¤Ï POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢
577 ¤½¤Î¾¤Î¿¤¯¤Î UNIX ¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£
578 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¿¤¯¤Î¾ì¹ç¡¢¥³¥¢¥À¥ó¥×½ÐÎϤòȼ¤¦¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
579
580 .\"O .B SIGPWR
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.
583 .B SIGPWR
584 ¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤³¤Î¥·¥°¥Ê¥ë¤¬Â¸ºß¤¹¤ë
585 ¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï¿¤¯¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£
586
587 .\"O .B SIGIO
588 .\"O (which is not specified in POSIX.1-2001) is ignored by default
589 .\"O on several other UNIX systems.
590 .B SIGIO
591 ¤Ï (POSIX.1-2001 ¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬) ¤¤¤¯¤Ä¤«¤Î¾¤Î UNIX ¥·¥¹¥Æ¥à¤Ç¤Ï
592 ¥Ç¥Õ¥©¥ë¥ÈÆ°ºî¤Ï̵»ë¤Ç¤¢¤ë¡£
593
594 .\"O Where defined,
595 .\"O .B SIGUNUSED
596 .\"O is synonymous with
597 .\"O .\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
598 .\"O .B SIGSYS
599 .\"O on most architectures.
600 .B SIGUNUSED
601 ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç
602 .B SIGSYS
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
613 .\"O .B SIGRTMIN
614 .\"O and
615 .\"O .BR SIGRTMAX .
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 Âбþ¤·¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈϰϤϡ¢¥Þ¥¯¥í
620 .B SIGRTMIN
621 ¤È
622 .B SIGRTMAX
623 ¤ÇÄêµÁ¤µ¤ì¤ë¡£
624 POSIX.1-2001 ¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â
625 .B _POSIX_RTSIG_MAX
626 (8) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤¿¼ÂÁõ¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¡£
627 .PP
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
632 .\"O (see
633 .\"O .BR pthreads (7)),
634 .\"O and adjusts the value of
635 .\"O .B SIGRTMIN
636 .\"O suitably (to 34 or 35).
637 Linux ¤Ï¡¢32 ¸Ä¤Î°Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ËÂбþ¤·¤Æ¤ª¤ê¡¢
638 ¤½¤ÎÈÖ¹æ¤Ï 33 ¤«¤é 64 ¤Ç¤¢¤ë¡£
639 ¤·¤«¤·¤Ê¤¬¤é¡¢glibc ¤Î POSIX ¥¹¥ì¥Ã¥É¼ÂÁõ¤Ï¡¢
640 ÆâÉô¤Ç 2¸Ä (NPTL ¤Î¾ì¹ç) ¤« 3¸Ä (LinuxThreads ¤Î¾ì¹ç) ¤Î
641 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Æ¤ª¤ê
642 .RB ( pthreads (7)
643 »²¾È)¡¢
644 .B SIGRTMIN
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,
650 .\"O programs should
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
655 .\"O .BR SIGRTMIN +n
656 .\"O does not exceed
657 .\"O .BR SIGRTMAX .
658 ÍøÍѲÄǽ¤Ê¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈϰϤϠglibc ¤Î¥¹¥ì¥Ã¥É¼ÂÁõ¤Ë¤è¤ê
659 °Û¤Ê¤ë¤· (»ÈÍѤ¹¤ë¥«¡¼¥Í¥ë¤È glibc ¤Ë¤è¤ê¼Â¹Ô»þ¤Ë¤âÊѲ½¤¹¤ë)¡¢
660 UNIX ¥·¥¹¥Æ¥à¤Î¼ïÎà¤Ë¤è¤Ã¤Æ¤â°Û¤Ê¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢
661 ¥×¥í¥°¥é¥à¤Ç¤Ï¡Ö¥Ï¡¼¥É¥³¡¼¥Ç¥£¥ó¥°¤·¤¿¿ô»ú¤ò»È¤Ã¤Æ¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î
662 »²¾È¤Ï·è¤·¤Æ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¯¡×¡¢Âå¤ï¤ê¤Ë
663 .BR SIGRTMIN +n
664 ¤Î·Á¤Ç»²¾È¤¹¤Ù¤­¤Ç¤¢¤ë¡£¤Þ¤¿¡¢
665 .BR SIGRTMIN +n
666 ¤¬
667 .B SIGRTMAX
668 ¤òĶ¤¨¤Æ¤¤¤Ê¤¤¤«¤Î¥Á¥§¥Ã¥¯¤ò (¼Â¹Ô»þ¤Ë) Å¬Àڤ˹Ԥ¦¤Ù¤­¤Ç¤¢¤ë¡£
669 .PP
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
672 .\"O purposes.
673 .\"O (Note, however, that the LinuxThreads implementation uses the first
674 .\"O three real-time signals.)
675 ɸ½à¥·¥°¥Ê¥ë¤È°Û¤Ê¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë¤Ï
676 »öÁ°¤ËÄêµÁ¤µ¤ì¤¿°ÕÌ£¤Ï¤Ê¤¤¡£
677 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÁ´Éô¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿ÍÑÅӤ˻Ȥ¨¤ë¡£
678 (⤷¡¢LinuxThreads ¼ÂÁõ¤Ç¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤Î¤¦¤Á
679 ºÇ½é¤Î 3¤Ä¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È)
680 .PP
681 .\"O The default action for an unhandled real-time signal is to terminate the
682 .\"O receiving process.
683 ¥Ï¥ó¥É¥ê¥ó¥°¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï
684 ¼õ¿®¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
685 .PP
686 .\"O Real-time signals are distinguished by the following:
687 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï°Ê²¼¤ÎÆÃħ¤¬¤¢¤ë:
688 .IP 1. 4
689 .\"O Multiple instances of real-time signals can be queued.
690 .\"O By contrast, if multiple instances of a standard signal are delivered
691 .\"O while that signal is currently blocked, then only one instance is queued.
692 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÊ£¿ô¤Î¼ÂÂΤò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
693 °ìÊý¡¢É¸½à¥·¥°¥Ê¥ë¤Î¾ì¹ç¡¢¤½¤Î¥·¥°¥Ê¥ë¤¬¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë
694 Ʊ¤¸¥·¥°¥Ê¥ë¤ÎÊ£¿ô¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ÇÛÁ÷¤µ¤ì¤Æ¤â¡¢
695 1 ¤Ä¤À¤±¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£
696 .IP 2. 4
697 .\"O If the signal is sent using
698 .\"O .BR sigqueue (2),
699 .\"O an accompanying value (either an integer or a pointer) can be sent
700 .\"O with the signal.
701 ¥·¥°¥Ê¥ë¤¬
702 .BR sigqueue (2)
703 ¤òÍѤ¤¤ÆÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢
704 ÉÕ°¥Ç¡¼¥¿ (À°¿ô¤«¥Ý¥¤¥ó¥¿) ¤ò¥·¥°¥Ê¥ë¤È¶¦¤ËÁ÷¿®¤Ç¤­¤ë¡£
705 .\"O If the receiving process establishes a handler for this signal using the
706 .\"O .B SA_SIGINFO
707 .\"O flag to
708 .\"O .BR sigaction (2)
709 .\"O then it can obtain this data via the
710 .\"O .I si_value
711 .\"O field of the
712 .\"O .I siginfo_t
713 .\"O structure passed as the second argument to the handler.
714 ¼õ¿®Â¦¥×¥í¥»¥¹¤¬
715 .BR sigaction (2)
716 ¤Ë
717 .B SA_SIGINFO
718 ¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¾ì¹ç¡¢
719 ¤³¤Î¥Ç¡¼¥¿¤Ï
720 .I siginfo_t
721 ¹½Â¤ÂΤÎ
722 .I si_value
723 ¥Õ¥£¡¼¥ë¥É·Ðͳ¤Ç¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¡¢
724 ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
725 .\"O Furthermore, the
726 .\"O .I si_pid
727 .\"O and
728 .\"O .I si_uid
729 .\"O fields of this structure can be used to obtain the PID
730 .\"O and real user ID of the process sending the signal.
731 ¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤÎ
732 .I si_pid
733 ¤È
734 .I si_uid
735 ¥Õ¥£¡¼¥ë¥É¤Ç¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤È¼Â¥æ¡¼¥¶ ID ¤ò
736 ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
737 .IP 3. 4
738 .\"O Real-time signals are delivered in a guaranteed order.
739 .\"O Multiple real-time signals of the same type are delivered in the order
740 .\"O they were sent.
741 .\"O If different real-time signals are sent to a process, they are delivered
742 .\"O starting with the lowest-numbered signal.
743 .\"O (I.e., low-numbered signals have highest priority.)
744 .\"O By contrast, if multiple standard signals are pending for a process,
745 .\"O the order in which they are delivered is unspecified.
746 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ç¤ÏÇÛÁ÷¤µ¤ì¤ë½ç½ø¤¬Êݾڤµ¤ì¤ë¡£
747 Ʊ¤¸¥¿¥¤¥×¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÏÁ÷¿®¤µ¤ì¤¿½çÈÖ¤ËÅþÃ夹¤ë¡£
748 °Û¤Ê¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢
749 ÈÖ¹æ¤Î¾®¤µ¤¤¥·¥°¥Ê¥ë¤«¤éÀè¤ËÅþÃ夹¤ë¡£
750 (¤Ä¤Þ¤ê¾®¤µ¤¤ÈÖ¹æ¤Î¥·¥°¥Ê¥ë¤¬¹â¤¤Í¥Àè½ç°Ì¤ò»ý¤Ä¡£)
751 ÂоÈŪ¤Ë¡¢°ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤ÆÊ£¿ô¤Îɸ½à¥·¥°¥Ê¥ë¤¬½èÍýÂÔ¤Á¤È¤Ê¤Ã¤¿¾ì¹ç¡¢
752 ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë½ç½ø¤ÏÉÔÄê¤Ç¤¢¤ë¡£
753 .PP
754 .\"O If both standard and real-time signals are pending for a process,
755 .\"O POSIX leaves it unspecified which is delivered first.
756 .\"O Linux, like many other implementations, gives priority
757 .\"O to standard signals in this case.
758 °ì¤Ä¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎξÊý¤¬
759 ½èÍýÂÔ¤Á¤Î¾ì¹ç¡¢POSIX ¤Ï¤É¤Á¤é¤¬Àè¤ËÇÛÁ÷¤µ¤ì¤ë¤«¤òµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£
760 Linux ¤Ç¤Ï¡¢Â¾¤Î¿¤¯¤Î¼ÂÁõ¤ÈƱÍÍ¡¢¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï
761 ɸ½à¥·¥°¥Ê¥ë¤¬Í¥À褵¤ì¤ë¡£
762 .PP
763 .\"O According to POSIX, an implementation should permit at least
764 .\"O .B _POSIX_SIGQUEUE_MAX
765 .\"O (32) real-time signals to be queued to
766 .\"O a process.
767 POSIX ¤Ë¤è¤ì¤Ð¡¢1 ¥×¥í¥»¥¹Ëè¤ËºÇÄã
768 .B _POSIX_SIGQUEUE_MAX
769 (32) ¸Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ò¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¤Ù¤­¤È¤·¤Æ¤¤¤ë¡£
770 .\"O However, Linux does things differently.
771 .\"O In kernels up to and including 2.6.7, Linux imposes
772 .\"O a system-wide limit on the number of queued real-time signals
773 .\"O for all processes.
774 ¤·¤«¤·¡¢ Linux ¤Ç¤Ï°ã¤Ã¤¿¼ÂÁõ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥«¡¼¥Í¥ë 2.6.7 ¤Þ¤Ç¤Ï
775 (2.6.7 ¤ò´Þ¤à)¡¢Á´¥×¥í¥»¥¹¤Ç¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë
776 ¤Î¿ô¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÀ©¸Â¤¬¤¢¤ë¡£
777 .\"O This limit can be viewed and (with privilege) changed via the
778 .\"O .I /proc/sys/kernel/rtsig-max
779 .\"O file.
780 .\"O A related file,
781 .\"O .IR /proc/sys/kernel/rtsig-nr ,
782 .\"O can be used to find out how many real-time signals are currently queued.
783 ¤³¤ÎÀ©¸Â¤Ï
784 .I /proc/sys/kernel/rtsig-max
785 ¥Õ¥¡¥¤¥ë¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¡¢ (¸¢¸Â¤¬¤¢¤ì¤Ð) Êѹ¹¤â¤Ç¤­¤ë¡£
786 ´Ø·¸¤¹¤ë¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢
787 .I /proc/sys/kernel/rtsig-nr
788 ¤ò¸«¤ë¤³¤È¤Ç¡¢¤¤¤¯¤Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¸½ºß¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¤«¤ò
789 ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£
790 .\"O In Linux 2.6.8, these
791 .\"O .I /proc
792 .\"O interfaces were replaced by the
793 .\"O .B RLIMIT_SIGPENDING
794 .\"O resource limit, which specifies a per-user limit for queued
795 .\"O signals; see
796 .\"O .BR setrlimit (2)
797 .\"O for further details.
798 Linux 2.6.8 ¤Ç¡¢¤³¤ì¤é¤Î
799 .I /proc
800 ·Ðͳ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢
801 .B RLIMIT_SIGPENDING
802 ¥ê¥½¡¼¥¹À©¸Â¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£
803 ¤³¤ì¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ë¥·¥°¥Ê¥ë¿ô¤Ë´Ø¤·¤Æ¥æ¡¼¥¶Ã±°Ì¤Ë
804 ¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£
805 ¾Ü¤·¤¯¤Ï
806 .BR setrlimit (2)
807 ¤ò»²¾È¡£
808 .\"O .SS "Async-signal-safe functions"
809 .SS "ÈóƱ´ü¥·¥°¥Ê¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô (async-signal-safe functions)"
810 .PP
811 .\"O A signal handler function must be very careful,
812 .\"O since processing elsewhere may be interrupted
813 .\"O at some arbitrary point in the execution of the program.
814 .\"O POSIX has the concept of "safe function".
815 .\"O If a signal interrupts the execution of an unsafe function, and
816 .\"O .I handler
817 .\"O calls an unsafe function, then the behavior of the program is undefined.
818 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ë¤ÏÈó¾ï¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
819 ¾¤Î¾ì½ê¤Î½èÍý¤Ï¥×¥í¥°¥é¥à¼Â¹Ô¤ÎǤ°Õ¤Î²Õ½ê¤ÇÃæÃǤµ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¤Ç¤¢¤ë¡£
820 POSIX ¤Ë¤Ï¡Ö°ÂÁ´¤Ê´Ø¿ô (safe function)¡×¤È¤¤¤¦³µÇ°¤¬¤¢¤ë¡£
821 ¥·¥°¥Ê¥ë¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Î¼Â¹Ô¤òÃæÃǤ·¡¢¤«¤Ä
822 .I handler
823 ¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢¥×¥í¥°¥é¥à¤ÎµóÆ°¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
824
825 .\"O POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2)
826 .\"O requires an implementation to guarantee that the following
827 .\"O functions can be safely called inside a signal handler:
828 POSIX.1-2004 (POSIX.1-2001 Technical Corrigendum (Àµ¸íɽ) 2 ¤È¤â¸À¤¦) ¤Ç¤Ï¡¢
829 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥éÆâ¤Ç¤Î°ÂÁ´¤Ê¸Æ¤Ó½Ð¤·¤òÊݾڤ¹¤ë¤³¤È¤¬É¬¿Ü¤Î´Ø¿ô¤È¤·¤Æ
830 °Ê²¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
831
832 .in +4
833 .nf
834 _Exit()
835 _exit()
836 abort()
837 accept()
838 access()
839 aio_error()
840 aio_return()
841 aio_suspend()
842 alarm()
843 bind()
844 cfgetispeed()
845 cfgetospeed()
846 cfsetispeed()
847 cfsetospeed()
848 chdir()
849 chmod()
850 chown()
851 clock_gettime()
852 close()
853 connect()
854 creat()
855 dup()
856 dup2()
857 execle()
858 execve()
859 fchmod()
860 fchown()
861 fcntl()
862 fdatasync()
863 fork()
864 fpathconf()
865 fstat()
866 fsync()
867 ftruncate()
868 getegid()
869 geteuid()
870 getgid()
871 getgroups()
872 getpeername()
873 getpgrp()
874 getpid()
875 getppid()
876 getsockname()
877 getsockopt()
878 getuid()
879 kill()
880 link()
881 listen()
882 lseek()
883 lstat()
884 mkdir()
885 mkfifo()
886 open()
887 pathconf()
888 pause()
889 pipe()
890 poll()
891 posix_trace_event()
892 pselect()
893 raise()
894 read()
895 readlink()
896 recv()
897 recvfrom()
898 recvmsg()
899 rename()
900 rmdir()
901 select()
902 sem_post()
903 send()
904 sendmsg()
905 sendto()
906 setgid()
907 setpgid()
908 setsid()
909 setsockopt()
910 setuid()
911 shutdown()
912 sigaction()
913 sigaddset()
914 sigdelset()
915 sigemptyset()
916 sigfillset()
917 sigismember()
918 signal()
919 sigpause()
920 sigpending()
921 sigprocmask()
922 sigqueue()
923 sigset()
924 sigsuspend()
925 sleep()
926 sockatmark()
927 socket()
928 socketpair()
929 stat()
930 symlink()
931 sysconf()
932 tcdrain()
933 tcflow()
934 tcflush()
935 tcgetattr()
936 tcgetpgrp()
937 tcsendbreak()
938 tcsetattr()
939 tcsetpgrp()
940 time()
941 timer_getoverrun()
942 timer_gettime()
943 timer_settime()
944 times()
945 umask()
946 uname()
947 unlink()
948 utime()
949 wait()
950 waitpid()
951 write()
952 .fi
953 .in
954 .PP
955 .\"O POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf()
956 .\"O from the above list, and adds the following functions:
957 POSIX.1-2008 ¤Ç¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Î¤¦¤Á fpathconf(), pathconf(), sysconf()
958 ¤¬ºï½ü¤µ¤ì¡¢°Ê²¼¤Î´Ø¿ô¤¬Äɲ䵤줿¡£
959 .PP
960 .in +4n
961 .nf
962 execl()
963 execv()
964 faccessat()
965 fchmodat()
966 fchownat()
967 fexecve()
968 fstatat()
969 futimens()
970 linkat()
971 mkdirat()
972 mkfifoat()
973 mknod()
974 mknodat()
975 openat()
976 readlinkat()
977 renameat()
978 symlinkat()
979 unlinkat()
980 utimensat()
981 utimes()
982 .fi
983 .in
984 .\"O .SS Interruption of System Calls and Library Functions by Signal Handlers
985 .SS ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß
986 .\"O If a signal handler is invoked while a system call or library
987 .\"O function call is blocked, then either:
988 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê¤¬Ää»ß (block) ¤·¤Æ¤¤¤ë´Ö¤Ë¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬
989 µ¯Æ°¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤É¤Á¤é¤«¤È¤Ê¤ë¡£
990 .IP * 2
991 .\"O the call is automatically restarted after the signal handler returns; or
992 ¥·¥°¥Ê¥ë¤¬Ê֤俸塢¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¡£
993 .IP *
994 .\"O the call fails with the error
995 .\"O .BR EINTR .
996 ¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼
997 .B EINTR
998 ¤Ç¼ºÇÔ¤¹¤ë¡£
999 .PP
1000 .\"O Which of these two behaviors occurs depends on the interface and
1001 .\"O whether or not the signal handler was established using the
1002 .\"O .BR SA_RESTART
1003 .\"O flag (see
1004 .\"O .BR sigaction (2)).
1005 .\"O The details vary across UNIX systems;
1006 .\"O below, the details for Linux.
1007 ¤³¤ì¤é¤ÎÆó¤Ä¤ÎµóÆ°¤Î¤¦¤Á¤É¤Á¤é¤¬µ¯¤³¤ë¤«¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤è¤ê°Í¸¤·¡¢
1008 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬
1009 .B SA_RESTART
1010 ¥Õ¥é¥°
1011 .RB ( sigaction (2)
1012 »²¾È) ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤¿¤«¤Ë¤â°Í¸¤¹¤ë¡£
1013 ¾ÜºÙ¤Ï UNIX ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
1014 Linux ¤Ë¤ª¤±¤ë¾ÜºÙ¤ò°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£
1015
1016 .\"O If a blocked call to one of the following interfaces is interrupted
1017 .\"O by a signal handler, then the call will be automatically restarted
1018 .\"O after the signal handler returns if the
1019 .\"O .BR SA_RESTART
1020 .\"O flag was used; otherwise the call will fail with the error
1021 .\"O .BR EINTR :
1022 .\"O .\" The following system calls use ERESTARTSYS,
1023 .\"O .\" so that they are restartable
1024 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë
1025 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢
1026 .B SA_RESTART
1027 ¥Õ¥é¥°¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë
1028 ¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
1029 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼
1030 .B EINTR
1031 ¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
1032 .\" °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ERESTARTSYS ¤ò»È¤Ã¤Æ¤¤¤ë¡£
1033 .\" ¤½¤Î¤¿¤á¡¢¤³¤ì¤é¤ÏºÆ¥¹¥¿¡¼¥È¤¬²Äǽ¤Ç¤¢¤ë¡£
1034 .RS 4
1035 .IP * 2
1036 .\"O .BR read (2),
1037 .\"O .BR readv (2),
1038 .\"O .BR write (2),
1039 .\"O .BR writev (2),
1040 .\"O and
1041 .\"O .BR ioctl (2)
1042 .\"O calls on "slow" devices.
1043 .\"O A "slow" device is one where the I/O call may block for an
1044 .\"O indefinite time, for example, a terminal, pipe, or socket.
1045 .\"O (A disk is not a slow device according to this definition.)
1046 .\"O If an I/O call on a slow device has already transferred some
1047 .\"O data by the time it is interrupted by a signal handler,
1048 .\"O then the call will return a success status
1049 .\"O (normally, the number of bytes transferred).
1050 .BR read (2),
1051 .BR readv (2),
1052 .BR write (2),
1053 .BR writev (2),
1054 .BR ioctl (2)
1055 ¤Î¡ÖÃÙ¤¤ (slow)¡×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¸Æ¤Ó½Ð¤·¡£
1056 ¤³¤³¤Ç¤¤¤¦¡ÖÃÙ¤¤¡×¥Ç¥Ð¥¤¥¹¤È¤Ï¡¢I/O ¸Æ¤Ó½Ð¤·¤¬Ìµ´ü¸Â¤ËÄä»ß (block) ¤¹¤ë
1057 ²ÄǽÀ­¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î¤³¤È¤Ç¡¢Îã¤È¤·¤Æ¤ÏüËö¡¢¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¤¬¤¢¤ë
1058 (¤³¤ÎÄêµÁ¤Ç¤Ï¡¢¥Ç¥£¥¹¥¯¤ÏÃÙ¤¤¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤)¡£
1059 ÃÙ¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë I/O ¸Æ¤Ó½Ð¤·¤¬¡¢
1060 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿»þÅÀ¤Þ¤Ç¤Ë²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò
1061 ¤¹¤Ç¤ËžÁ÷¤·¤Æ¤¤¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¤ÏÀ®¸ù¥¹¥Æ¡¼¥¿¥¹
1062 (Ä̾ï¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ð¥¤¥È¿ô) ¤òÊÖ¤¹¤³¤È¤À¤í¤¦¡£
1063 .IP *
1064 .\"O .BR open (2),
1065 .\"O if it can block (e.g., when opening a FIFO; see
1066 .\"O .BR fifo (7)).
1067 Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë
1068 .BR open (2)
1069 (Î㤨¤Ð¡¢FIFO ¤Î¥ª¡¼¥×¥ó»þ;
1070 .BR fifo (7)
1071 »²¾È)¡£
1072 .IP *
1073 .\"O .BR wait (2),
1074 .\"O .BR wait3 (2),
1075 .\"O .BR wait4 (2),
1076 .\"O .BR waitid (2),
1077 .\"O and
1078 .\"O .BR waitpid (2).
1079 .BR wait (2),
1080 .BR wait3 (2),
1081 .BR wait4 (2),
1082 .BR waitid (2),
1083 .BR waitpid (2).
1084 .IP *
1085 .\"O Socket interfaces:
1086 ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1087 .\" If a timeout (setsockopt()) is in effect on the socket, then these
1088 .\" system calls switch to using EINTR.  Consequently, they and are not
1089 .\" automatically restarted, and they show the stop/cont behavior
1090 .\" described below.  (Verified from 2.6.26 source, and by experiment; mtk)
1091 .\"O .BR accept (2),
1092 .\"O .BR connect (2),
1093 .\"O .BR recv (2),
1094 .\"O .BR recvfrom (2),
1095 .\"O .BR recvmsg (2),
1096 .\"O .BR send (2),
1097 .\"O .BR sendto (2),
1098 .\"O and
1099 .\"O .BR sendmsg (2),
1100 .\"O unless a timeout has been set on the socket (see below).
1101 .BR accept (2),
1102 .BR connect (2),
1103 .BR recv (2),
1104 .BR recvfrom (2),
1105 .BR recvmsg (2),
1106 .BR send (2),
1107 .BR sendto (2),
1108 .BR sendmsg (2).
1109 ⤷¡¢¥½¥±¥Ã¥È¤Ë¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç (²¼µ­»²¾È)¡£
1110 .IP *
1111 .\"O File locking interfaces:
1112 ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ÍÑ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1113 .\"O .BR flock (2)
1114 .\"O and
1115 .\"O .BR fcntl (2)
1116 .\"O .BR F_SETLKW .
1117 .BR flock (2),
1118 .BR fcntl (2)
1119 .BR F_SETLKW .
1120 .IP *
1121 .\"O POSIX message queue interfaces:
1122 POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1123 .BR mq_receive (3),
1124 .BR mq_timedreceive (3),
1125 .BR mq_send (3),
1126 .\"O and
1127 .BR mq_timedsend (3).
1128 .IP *
1129 .BR futex (2)
1130 .B FUTEX_WAIT
1131 .\"O (since Linux 2.6.22; beforehand, always failed with
1132 .\"O .BR EINTR ).
1133 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1134 .B EINTR
1135 ¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£
1136 .IP *
1137 .\"O POSIX semaphore interfaces:
1138 POSIX ¥»¥Þ¥Õ¥©¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1139 .\"O .BR sem_wait (3)
1140 .\"O and
1141 .\"O .BR sem_timedwait (3)
1142 .\"O (since Linux 2.6.22; beforehand, always failed with
1143 .\"O .BR EINTR ).
1144 .BR sem_wait (3),
1145 .BR sem_timedwait (3)
1146 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1147 .B EINTR
1148 ¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£
1149 .RE
1150 .PP
1151 .\"O The following interfaces are never restarted after
1152 .\"O being interrupted by a signal handler,
1153 .\"O regardless of the use of
1154 .\"O .BR SA_RESTART ;
1155 .\"O they always fail with the error
1156 .\"O .B EINTR
1157 .\"O when interrupted by a signal handler:
1158 .\"O .\" These are the system calls that give EINTR or ERESTARTNOHAND
1159 .\"O .\" on interruption by a signal handler.
1160 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1161 .B SA_RESTART
1162 ¤ò»È¤Ã¤Æ¤¤¤ë¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢
1163 ºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£
1164 ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¾ï¤Ë¥¨¥é¡¼
1165 .B EINTR
1166 ¤Ç¼ºÇÔ¤¹¤ë¡£
1167 .\" ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë³ä¤ê¹þ¤ß¤ÎºÝ¤Ë
1168 .\" EINTR ¤« ERESTARTNOHAND ¤òÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£
1169 .RS 4
1170 .IP * 2
1171 .\"O Socket interfaces, when a timeout has been set on the socket using
1172 .\"O .BR setsockopt (2):
1173 .\"O .BR accept (2),
1174 .\"O .BR recv (2),
1175 .\"O .BR recvfrom (2),
1176 .\"O and
1177 .\"O .BR recvmsg (2),
1178 .\"O if a receive timeout
1179 .\"O .RB ( SO_RCVTIMEO )
1180 .\"O has been set;
1181 .\"O .BR connect (2),
1182 .\"O .BR send (2),
1183 .\"O .BR sendto (2),
1184 .\"O and
1185 .\"O .BR sendmsg (2),
1186 .\"O if a send timeout
1187 .\"O .RB ( SO_SNDTIMEO )
1188 .\"O has been set.
1189 .BR setsockopt (2)
1190 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1191 .BR accept (2),
1192 .BR recv (2),
1193 .BR recvfrom (2),
1194 .BR recvmsg (2)
1195 ¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È
1196 .RB ( SO_RCVTIMEO )
1197 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1198 .BR connect (2),
1199 .BR send (2),
1200 .BR sendto (2),
1201 .BR sendmsg (2)
1202 ¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È
1203 .RB ( SO_SNDTIMEO )
1204 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1205 .IP *
1206 .\"O Interfaces used to wait for signals:
1207 ¥·¥°¥Ê¥ëÂÔ¤Á¤Ë»È¤ï¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1208 .BR pause (2),
1209 .BR sigsuspend (2),
1210 .BR sigtimedwait (2),
1211 .\"O and
1212 .BR sigwaitinfo (2).
1213 .IP *
1214 .\"O File descriptor multiplexing interfaces:
1215 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1216 .BR epoll_wait (2),
1217 .BR epoll_pwait (2),
1218 .BR poll (2),
1219 .BR ppoll (2),
1220 .BR select (2),
1221 .\"O and
1222 .BR pselect (2).
1223 .IP *
1224 .\"O System V IPC interfaces:
1225 System V IPC ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1226 .\" On some other systems, SA_RESTART does restart these system calls
1227 .BR msgrcv (2),
1228 .BR msgsnd (2),
1229 .BR semop (2),
1230 .\"O and
1231 .BR semtimedop (2).
1232 .IP *
1233 .\"O Sleep interfaces:
1234 ¥¹¥ê¡¼¥×ÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1235 .BR clock_nanosleep (2),
1236 .BR nanosleep (2),
1237 .\"O and
1238 .BR usleep (3).
1239 .IP *
1240 .\"O .BR read (2)
1241 .\"O from an
1242 .\"O .BR inotify (7)
1243 .\"O file descriptor.
1244 .BR inotify (7)
1245 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1246 .BR read (2).
1247 .IP *
1248 .BR io_getevents (2).
1249 .RE
1250 .PP
1251 .\"O The
1252 .\"O .BR sleep (3)
1253 .\"O function is also never restarted if interrupted by a handler,
1254 .\"O but gives a success return: the number of seconds remaining to sleep.
1255 .BR sleep (3)
1256 ´Ø¿ô¤â¡¢¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢·è¤·¤ÆºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ï¤Ê¤¤¡£
1257 ¤·¤«¤·¡¢À®¸ù¤È¤Ê¤ê¡¢»Ä¤Ã¤Æ¤¤¤ëÄä»ß»þ´Ö¤òÊÖ¤¹¡£
1258 .\"O .SS Interruption of System Calls and Library Functions by Stop Signals
1259 .SS °ì»þÄä»ß¥·¥°¥Ê¥ë¤Ë¤è¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤ä¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ø¤Î³ä¤ê¹þ¤ß
1260 .\"O On Linux, even in the absence of signal handlers,
1261 .\"O certain blocking interfaces can fail with the error
1262 .\"O .BR EINTR
1263 .\"O after the process is stopped by one of the stop signals
1264 .\"O and then resumed via
1265 .\"O .BR SIGCONT .
1266 .\"O This behavior is not sanctioned by POSIX.1, and doesn't occur
1267 .\"O on other systems.
1268 Linux ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
1269 ¤¤¤¯¤Ä¤«¤Î¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1270 ¥×¥í¥»¥¹¤¬°ì»þÄä»ß (stop) ¥·¥°¥Ê¥ë¤Î°ì¤Ä¤Ë¤è¤êÄä»ß¤µ¤ì¡¢
1271 .B SIGCONT
1272 ¤Ë¤è¤êºÆ³«¤µ¤ì¤¿¸å¤Ë¡¢¥¨¥é¡¼
1273 .B EINTR
1274 ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
1275 ¤³¤ÎµóÆ°¤Ï POSIX.1 ¤Çǧ¤á¤é¤ì¤Æ¤ª¤é¤º¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ïµ¯¤³¤é¤Ê¤¤¡£
1276
1277 .\"O The Linux interfaces that display this behavior are:
1278 ¤³¤ÎµóÆ°¤ò¼¨¤¹ Linux ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
1279 .RS 4
1280 .IP * 2
1281 .\"O Socket interfaces, when a timeout has been set on the socket using
1282 .\"O .BR setsockopt (2):
1283 .\"O .BR accept (2),
1284 .\"O .BR recv (2),
1285 .\"O .BR recvfrom (2),
1286 .\"O and
1287 .\"O .BR recvmsg (2),
1288 .\"O if a receive timeout
1289 .\"O .RB ( SO_RCVTIMEO )
1290 .\"O has been set;
1291 .\"O .BR connect (2),
1292 .\"O .BR send (2),
1293 .\"O .BR sendto (2),
1294 .\"O and
1295 .\"O .BR sendmsg (2),
1296 .\"O if a send timeout
1297 .\"O .RB ( SO_SNDTIMEO )
1298 .\"O has been set.
1299 .BR setsockopt (2)
1300 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1301 .BR accept (2),
1302 .BR recv (2),
1303 .BR recvfrom (2),
1304 .BR recvmsg (2)
1305 ¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È
1306 .RB ( SO_RCVTIMEO )
1307 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1308 .BR connect (2),
1309 .BR send (2),
1310 .BR sendto (2),
1311 .BR sendmsg (2)
1312 ¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È
1313 .RB ( SO_SNDTIMEO )
1314 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1315 .IP * 2
1316 .BR epoll_wait (2),
1317 .BR epoll_pwait (2).
1318 .IP *
1319 .BR semop (2),
1320 .BR semtimedop (2).
1321 .IP *
1322 .BR sigtimedwait (2),
1323 .BR sigwaitinfo (2).
1324 .IP *
1325 .\"O .BR read (2)
1326 .\"O from an
1327 .\"O .BR inotify (7)
1328 .\"O file descriptor.
1329 .BR inotify (7)
1330 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1331 .BR read (2).
1332 .IP *
1333 .\"O Linux 2.6.21 and earlier:
1334 Linux 2.6.21 °ÊÁ°:
1335 .BR futex (2)
1336 .BR FUTEX_WAIT ,
1337 .BR sem_timedwait (3),
1338 .BR sem_wait (3).
1339 .IP *
1340 .\"O Linux 2.6.8 and earlier:
1341 Linux 2.6.8 °ÊÁ°:
1342 .BR msgrcv (2),
1343 .BR msgsnd (2).
1344 .IP *
1345 .\"O Linux 2.4 and earlier:
1346 Linux 2.4 °ÊÁ°:
1347 .BR nanosleep (2).
1348 .RE
1349 .\"O .SH "CONFORMING TO"
1350 .SH ½àµò
1351 .\"O POSIX.1, except as noted.
1352 POSIX.1 (Ãíµ­¤·¤¿ÆâÍưʳ°)¡£
1353 .\"O .SH BUGS
1354 .SH ¥Ð¥°
1355 .\"O .B SIGIO
1356 .\"O and
1357 .\"O .B SIGLOST
1358 .\"O have the same value.
1359 .\"O The latter is commented out in the kernel source, but
1360 .\"O the build process of some software still thinks that
1361 .\"O signal 29 is
1362 .\"O .BR SIGLOST .
1363 .B SIGIO
1364 ¤È
1365 .B SIGLOST
1366 ¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤¤¤ë¡£
1367 .B SIGLOST
1368 ¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤Ç¤Ï¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¡£
1369 ¤·¤«¤·¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤Æ¤Ï¥Ó¥ë¥É¤Î²áÄø¤Ç¥·¥°¥Ê¥ë 29 ¤ò
1370 .B SIGLOST
1371 ¤È¤ß¤Ê¤·¤Æ¤·¤Þ¤¦¤â¤Î¤¬¤¢¤ë¡£
1372 .\"O .SH "SEE ALSO"
1373 .SH ´ØÏ¢¹àÌÜ
1374 .BR kill (1),
1375 .BR getrlimit (2),
1376 .BR kill (2),
1377 .BR killpg (2),
1378 .BR setitimer (2),
1379 .BR setrlimit (2),
1380 .BR sgetmask (2),
1381 .BR sigaction (2),
1382 .BR sigaltstack (2),
1383 .BR signal (2),
1384 .BR signalfd (2),
1385 .BR sigpending (2),
1386 .BR sigprocmask (2),
1387 .BR sigqueue (2),
1388 .BR sigsuspend (2),
1389 .BR sigwaitinfo (2),
1390 .BR abort (3),
1391 .BR bsd_signal (3),
1392 .BR longjmp (3),
1393 .BR raise (3),
1394 .BR sigset (3),
1395 .BR sigsetops (3),
1396 .BR sigvec (3),
1397 .BR sigwait (3),
1398 .BR strsignal (3),
1399 .BR sysv_signal (3),
1400 .BR core (5),
1401 .BR proc (5),
1402 .BR pthreads (7),
1403 .BR sigevent (7)