OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[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  2011-09-18 "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 (3)
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 ɸ½à¥·¥°¥Ê¥ë¤È°Û¤Ê¤ê¡¢¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ë¤Ï
674 »öÁ°¤ËÄêµÁ¤µ¤ì¤¿°ÕÌ£¤Ï¤Ê¤¤¡£
675 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤ÎÁ´Éô¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿ÍÑÅӤ˻Ȥ¨¤ë¡£
676 .PP
677 .\"O The default action for an unhandled real-time signal is to terminate the
678 .\"O receiving process.
679 ¥Ï¥ó¥É¥ê¥ó¥°¤·¤Ê¤¤¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï
680 ¼õ¿®¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
681 .PP
682 .\"O Real-time signals are distinguished by the following:
683 ¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤Ï°Ê²¼¤ÎÆÃħ¤¬¤¢¤ë:
684 .IP 1. 4
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 ¤Ä¤À¤±¤¬¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¡£
692 .IP 2. 4
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.
697 ¥·¥°¥Ê¥ë¤¬
698 .BR sigqueue (3)
699 ¤òÍѤ¤¤ÆÁ÷¿®¤µ¤ì¤¿¾ì¹ç¡¢
700 ÉÕ°¥Ç¡¼¥¿ (À°¿ô¤«¥Ý¥¤¥ó¥¿) ¤ò¥·¥°¥Ê¥ë¤È¶¦¤ËÁ÷¿®¤Ç¤­¤ë¡£
701 .\"O If the receiving process establishes a handler for this signal using the
702 .\"O .B SA_SIGINFO
703 .\"O flag to
704 .\"O .BR sigaction (2)
705 .\"O then it can obtain this data via the
706 .\"O .I si_value
707 .\"O field of the
708 .\"O .I siginfo_t
709 .\"O structure passed as the second argument to the handler.
710 ¼õ¿®Â¦¥×¥í¥»¥¹¤¬
711 .BR sigaction (2)
712 ¤Ë
713 .B SA_SIGINFO
714 ¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀßÄꤷ¤¿¾ì¹ç¡¢
715 ¤³¤Î¥Ç¡¼¥¿¤Ï
716 .I siginfo_t
717 ¹½Â¤ÂΤÎ
718 .I si_value
719 ¥Õ¥£¡¼¥ë¥É·Ðͳ¤Ç¥Ï¥ó¥É¥é¤ÎÂè 2 °ú¤­¿ô¤È¤·¤ÆÅϤµ¤ì¡¢
720 ÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
721 .\"O Furthermore, the
722 .\"O .I si_pid
723 .\"O and
724 .\"O .I si_uid
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.
727 ¤µ¤é¤Ë¡¢¤³¤Î¹½Â¤ÂΤÎ
728 .I si_pid
729 ¤È
730 .I si_uid
731 ¥Õ¥£¡¼¥ë¥É¤Ç¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤¿¥×¥í¥»¥¹¤Î PID ¤È¼Â¥æ¡¼¥¶ ID ¤ò
732 ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
733 .IP 3. 4
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
736 .\"O they were sent.
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 ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë½ç½ø¤ÏÉÔÄê¤Ç¤¢¤ë¡£
749 .PP
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 ɸ½à¥·¥°¥Ê¥ë¤¬Í¥À褵¤ì¤ë¡£
758 .PP
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
762 .\"O a process.
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
775 .\"O file.
776 .\"O A related file,
777 .\"O .IR /proc/sys/kernel/rtsig-nr ,
778 .\"O can be used to find out how many real-time signals are currently queued.
779 ¤³¤ÎÀ©¸Â¤Ï
780 .I /proc/sys/kernel/rtsig-max
781 ¥Õ¥¡¥¤¥ë¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¡¢ (¸¢¸Â¤¬¤¢¤ì¤Ð) Êѹ¹¤â¤Ç¤­¤ë¡£
782 ´Ø·¸¤¹¤ë¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢
783 .I /proc/sys/kernel/rtsig-nr
784 ¤ò¸«¤ë¤³¤È¤Ç¡¢¤¤¤¯¤Ä¤Î¥ê¥¢¥ë¥¿¥¤¥à¥·¥°¥Ê¥ë¤¬¸½ºß¥­¥å¡¼¤ËÆþ¤Ã¤Æ¤¤¤ë¤«¤ò
785 ÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£
786 .\"O In Linux 2.6.8, these
787 .\"O .I /proc
788 .\"O interfaces were replaced by the
789 .\"O .B RLIMIT_SIGPENDING
790 .\"O resource limit, which specifies a per-user limit for queued
791 .\"O signals; see
792 .\"O .BR setrlimit (2)
793 .\"O for further details.
794 Linux 2.6.8 ¤Ç¡¢¤³¤ì¤é¤Î
795 .I /proc
796 ·Ðͳ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï¡¢
797 .B RLIMIT_SIGPENDING
798 ¥ê¥½¡¼¥¹À©¸Â¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿¡£
799 ¤³¤ì¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ë¥·¥°¥Ê¥ë¿ô¤Ë´Ø¤·¤Æ¥æ¡¼¥¶Ã±°Ì¤Ë
800 ¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£
801 ¾Ü¤·¤¯¤Ï
802 .BR setrlimit (2)
803 ¤ò»²¾È¡£
804 .\"O .SS "Async-signal-safe functions"
805 .SS "ÈóƱ´ü¥·¥°¥Ê¥ë¤Ç°ÂÁ´¤Ê´Ø¿ô (async-signal-safe functions)"
806 .PP
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
812 .\"O .I handler
813 .\"O calls an unsafe function, then the behavior of the program is undefined.
814 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é´Ø¿ô¤Ë¤ÏÈó¾ï¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
815 ¾¤Î¾ì½ê¤Î½èÍý¤Ï¥×¥í¥°¥é¥à¼Â¹Ô¤ÎǤ°Õ¤Î²Õ½ê¤ÇÃæÃǤµ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¤Ç¤¢¤ë¡£
816 POSIX ¤Ë¤Ï¡Ö°ÂÁ´¤Ê´Ø¿ô (safe function)¡×¤È¤¤¤¦³µÇ°¤¬¤¢¤ë¡£
817 ¥·¥°¥Ê¥ë¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Î¼Â¹Ô¤òÃæÃǤ·¡¢¤«¤Ä
818 .I handler
819 ¤¬°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¡¢¥×¥í¥°¥é¥à¤ÎµóÆ°¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
820
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 °Ê²¼¤¬µ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
827
828 .in +4
829 .nf
830 _Exit()
831 _exit()
832 abort()
833 accept()
834 access()
835 aio_error()
836 aio_return()
837 aio_suspend()
838 alarm()
839 bind()
840 cfgetispeed()
841 cfgetospeed()
842 cfsetispeed()
843 cfsetospeed()
844 chdir()
845 chmod()
846 chown()
847 clock_gettime()
848 close()
849 connect()
850 creat()
851 dup()
852 dup2()
853 execle()
854 execve()
855 fchmod()
856 fchown()
857 fcntl()
858 fdatasync()
859 fork()
860 fpathconf()
861 fstat()
862 fsync()
863 ftruncate()
864 getegid()
865 geteuid()
866 getgid()
867 getgroups()
868 getpeername()
869 getpgrp()
870 getpid()
871 getppid()
872 getsockname()
873 getsockopt()
874 getuid()
875 kill()
876 link()
877 listen()
878 lseek()
879 lstat()
880 mkdir()
881 mkfifo()
882 open()
883 pathconf()
884 pause()
885 pipe()
886 poll()
887 posix_trace_event()
888 pselect()
889 raise()
890 read()
891 readlink()
892 recv()
893 recvfrom()
894 recvmsg()
895 rename()
896 rmdir()
897 select()
898 sem_post()
899 send()
900 sendmsg()
901 sendto()
902 setgid()
903 setpgid()
904 setsid()
905 setsockopt()
906 setuid()
907 shutdown()
908 sigaction()
909 sigaddset()
910 sigdelset()
911 sigemptyset()
912 sigfillset()
913 sigismember()
914 signal()
915 sigpause()
916 sigpending()
917 sigprocmask()
918 sigqueue()
919 sigset()
920 sigsuspend()
921 sleep()
922 sockatmark()
923 socket()
924 socketpair()
925 stat()
926 symlink()
927 sysconf()
928 tcdrain()
929 tcflow()
930 tcflush()
931 tcgetattr()
932 tcgetpgrp()
933 tcsendbreak()
934 tcsetattr()
935 tcsetpgrp()
936 time()
937 timer_getoverrun()
938 timer_gettime()
939 timer_settime()
940 times()
941 umask()
942 uname()
943 unlink()
944 utime()
945 wait()
946 waitpid()
947 write()
948 .fi
949 .in
950 .PP
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 ¤¬ºï½ü¤µ¤ì¡¢°Ê²¼¤Î´Ø¿ô¤¬Äɲ䵤줿¡£
955 .PP
956 .in +4n
957 .nf
958 execl()
959 execv()
960 faccessat()
961 fchmodat()
962 fchownat()
963 fexecve()
964 fstatat()
965 futimens()
966 linkat()
967 mkdirat()
968 mkfifoat()
969 mknod()
970 mknodat()
971 openat()
972 readlinkat()
973 renameat()
974 symlinkat()
975 unlinkat()
976 utimensat()
977 utimes()
978 .fi
979 .in
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 µ¯Æ°¤µ¤ì¤ë¤È¡¢°Ê²¼¤Î¤É¤Á¤é¤«¤È¤Ê¤ë¡£
986 .IP * 2
987 .\"O the call is automatically restarted after the signal handler returns; or
988 ¥·¥°¥Ê¥ë¤¬Ê֤俸塢¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¡£
989 .IP *
990 .\"O the call fails with the error
991 .\"O .BR EINTR .
992 ¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼
993 .B EINTR
994 ¤Ç¼ºÇÔ¤¹¤ë¡£
995 .PP
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
998 .\"O .BR SA_RESTART
999 .\"O flag (see
1000 .\"O .BR sigaction (2)).
1001 .\"O The details vary across UNIX systems;
1002 .\"O below, the details for Linux.
1003 ¤³¤ì¤é¤ÎÆó¤Ä¤ÎµóÆ°¤Î¤¦¤Á¤É¤Á¤é¤¬µ¯¤³¤ë¤«¤Ï¡¢¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ë¤è¤ê°Í¸¤·¡¢
1004 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬
1005 .B SA_RESTART
1006 ¥Õ¥é¥°
1007 .RB ( sigaction (2)
1008 »²¾È) ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤¿¤«¤Ë¤â°Í¸¤¹¤ë¡£
1009 ¾ÜºÙ¤Ï UNIX ¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
1010 Linux ¤Ë¤ª¤±¤ë¾ÜºÙ¤ò°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£
1011
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
1015 .\"O .BR SA_RESTART
1016 .\"O flag was used; otherwise the call will fail with the error
1017 .\"O .BR EINTR :
1018 .\"O .\" The following system calls use ERESTARTSYS,
1019 .\"O .\" so that they are restartable
1020 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Î¤¤¤º¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë
1021 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢
1022 .B SA_RESTART
1023 ¥Õ¥é¥°¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ì¤Ð¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬Ê֤俸å¤Ë
1024 ¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
1025 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¤½¤Î¸Æ¤Ó½Ð¤·¤Ï¥¨¥é¡¼
1026 .B EINTR
1027 ¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
1028 .\" °Ê²¼¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ERESTARTSYS ¤ò»È¤Ã¤Æ¤¤¤ë¡£
1029 .\" ¤½¤Î¤¿¤á¡¢¤³¤ì¤é¤ÏºÆ¥¹¥¿¡¼¥È¤¬²Äǽ¤Ç¤¢¤ë¡£
1030 .RS 4
1031 .IP * 2
1032 .\"O .BR read (2),
1033 .\"O .BR readv (2),
1034 .\"O .BR write (2),
1035 .\"O .BR writev (2),
1036 .\"O and
1037 .\"O .BR ioctl (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).
1046 .BR read (2),
1047 .BR readv (2),
1048 .BR write (2),
1049 .BR writev (2),
1050 .BR ioctl (2)
1051 ¤Î¡ÖÃÙ¤¤ (slow)¡×¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë¸Æ¤Ó½Ð¤·¡£
1052 ¤³¤³¤Ç¤¤¤¦¡ÖÃÙ¤¤¡×¥Ç¥Ð¥¤¥¹¤È¤Ï¡¢I/O ¸Æ¤Ó½Ð¤·¤¬Ìµ´ü¸Â¤ËÄä»ß (block) ¤¹¤ë
1053 ²ÄǽÀ­¤Î¤¢¤ë¥Ç¥Ð¥¤¥¹¤Î¤³¤È¤Ç¡¢Îã¤È¤·¤Æ¤ÏüËö¡¢¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¤¬¤¢¤ë
1054 (¤³¤ÎÄêµÁ¤Ç¤Ï¡¢¥Ç¥£¥¹¥¯¤ÏÃÙ¤¤¥Ç¥Ð¥¤¥¹¤Ç¤Ï¤Ê¤¤)¡£
1055 ÃÙ¤¤¥Ç¥Ð¥¤¥¹¤ËÂФ¹¤ë I/O ¸Æ¤Ó½Ð¤·¤¬¡¢
1056 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿»þÅÀ¤Þ¤Ç¤Ë²¿¤é¤«¤Î¥Ç¡¼¥¿¤ò
1057 ¤¹¤Ç¤ËžÁ÷¤·¤Æ¤¤¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¤ÏÀ®¸ù¥¹¥Æ¡¼¥¿¥¹
1058 (Ä̾ï¤Ï¡¢Å¾Á÷¤µ¤ì¤¿¥Ð¥¤¥È¿ô) ¤òÊÖ¤¹¤³¤È¤À¤í¤¦¡£
1059 .IP *
1060 .\"O .BR open (2),
1061 .\"O if it can block (e.g., when opening a FIFO; see
1062 .\"O .BR fifo (7)).
1063 Ää»ß (block) ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë
1064 .BR open (2)
1065 (Î㤨¤Ð¡¢FIFO ¤Î¥ª¡¼¥×¥ó»þ;
1066 .BR fifo (7)
1067 »²¾È)¡£
1068 .IP *
1069 .\"O .BR wait (2),
1070 .\"O .BR wait3 (2),
1071 .\"O .BR wait4 (2),
1072 .\"O .BR waitid (2),
1073 .\"O and
1074 .\"O .BR waitpid (2).
1075 .BR wait (2),
1076 .BR wait3 (2),
1077 .BR wait4 (2),
1078 .BR waitid (2),
1079 .BR waitpid (2).
1080 .IP *
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),
1089 .\"O .BR recv (2),
1090 .\"O .BR recvfrom (2),
1091 .\"O .BR recvmsg (2),
1092 .\"O .BR send (2),
1093 .\"O .BR sendto (2),
1094 .\"O and
1095 .\"O .BR sendmsg (2),
1096 .\"O unless a timeout has been set on the socket (see below).
1097 .BR accept (2),
1098 .BR connect (2),
1099 .BR recv (2),
1100 .BR recvfrom (2),
1101 .BR recvmsg (2),
1102 .BR send (2),
1103 .BR sendto (2),
1104 .BR sendmsg (2).
1105 ⤷¡¢¥½¥±¥Ã¥È¤Ë¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç (²¼µ­»²¾È)¡£
1106 .IP *
1107 .\"O File locking interfaces:
1108 ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯ÍÑ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1109 .\"O .BR flock (2)
1110 .\"O and
1111 .\"O .BR fcntl (2)
1112 .\"O .BR F_SETLKW .
1113 .BR flock (2),
1114 .BR fcntl (2)
1115 .BR F_SETLKW .
1116 .IP *
1117 .\"O POSIX message queue interfaces:
1118 POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1119 .BR mq_receive (3),
1120 .BR mq_timedreceive (3),
1121 .BR mq_send (3),
1122 .\"O and
1123 .BR mq_timedsend (3).
1124 .IP *
1125 .BR futex (2)
1126 .B FUTEX_WAIT
1127 .\"O (since Linux 2.6.22; beforehand, always failed with
1128 .\"O .BR EINTR ).
1129 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1130 .B EINTR
1131 ¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£
1132 .IP *
1133 .\"O POSIX semaphore interfaces:
1134 POSIX ¥»¥Þ¥Õ¥©¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1135 .\"O .BR sem_wait (3)
1136 .\"O and
1137 .\"O .BR sem_timedwait (3)
1138 .\"O (since Linux 2.6.22; beforehand, always failed with
1139 .\"O .BR EINTR ).
1140 .BR sem_wait (3),
1141 .BR sem_timedwait (3)
1142 (Linux 2.6.22 °Ê¹ß; ¤½¤ì°ÊÁ°¤Ï¾ï¤Ë
1143 .B EINTR
1144 ¤Ç¼ºÇÔ¤·¤Æ¤¤¤¿)¡£
1145 .RE
1146 .PP
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
1152 .\"O .B EINTR
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 °Ê²¼¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1157 .B SA_RESTART
1158 ¤ò»È¤Ã¤Æ¤¤¤ë¤É¤¦¤«¤Ë´Ø¤ï¤é¤º¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢
1159 ºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£
1160 ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤ë¤È¡¢¾ï¤Ë¥¨¥é¡¼
1161 .B EINTR
1162 ¤Ç¼ºÇÔ¤¹¤ë¡£
1163 .\" ¤³¤ì¤é¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ë³ä¤ê¹þ¤ß¤ÎºÝ¤Ë
1164 .\" EINTR ¤« ERESTARTNOHAND ¤òÊÖ¤¹¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ë¡£
1165 .RS 4
1166 .IP * 2
1167 .\"O Socket interfaces, when a timeout has been set on the socket using
1168 .\"O .BR setsockopt (2):
1169 .\"O .BR accept (2),
1170 .\"O .BR recv (2),
1171 .\"O .BR recvfrom (2),
1172 .\"O and
1173 .\"O .BR recvmsg (2),
1174 .\"O if a receive timeout
1175 .\"O .RB ( SO_RCVTIMEO )
1176 .\"O has been set;
1177 .\"O .BR connect (2),
1178 .\"O .BR send (2),
1179 .\"O .BR sendto (2),
1180 .\"O and
1181 .\"O .BR sendmsg (2),
1182 .\"O if a send timeout
1183 .\"O .RB ( SO_SNDTIMEO )
1184 .\"O has been set.
1185 .BR setsockopt (2)
1186 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1187 .BR accept (2),
1188 .BR recv (2),
1189 .BR recvfrom (2),
1190 .BR recvmsg (2)
1191 ¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È
1192 .RB ( SO_RCVTIMEO )
1193 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1194 .BR connect (2),
1195 .BR send (2),
1196 .BR sendto (2),
1197 .BR sendmsg (2)
1198 ¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È
1199 .RB ( SO_SNDTIMEO )
1200 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1201 .IP *
1202 .\"O Interfaces used to wait for signals:
1203 ¥·¥°¥Ê¥ëÂÔ¤Á¤Ë»È¤ï¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1204 .BR pause (2),
1205 .BR sigsuspend (2),
1206 .BR sigtimedwait (2),
1207 .\"O and
1208 .BR sigwaitinfo (2).
1209 .IP *
1210 .\"O File descriptor multiplexing interfaces:
1211 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1212 .BR epoll_wait (2),
1213 .BR epoll_pwait (2),
1214 .BR poll (2),
1215 .BR ppoll (2),
1216 .BR select (2),
1217 .\"O and
1218 .BR pselect (2).
1219 .IP *
1220 .\"O System V IPC interfaces:
1221 System V IPC ¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1222 .\" On some other systems, SA_RESTART does restart these system calls
1223 .BR msgrcv (2),
1224 .BR msgsnd (2),
1225 .BR semop (2),
1226 .\"O and
1227 .BR semtimedop (2).
1228 .IP *
1229 .\"O Sleep interfaces:
1230 ¥¹¥ê¡¼¥×ÍѤΥ¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹:
1231 .BR clock_nanosleep (2),
1232 .BR nanosleep (2),
1233 .\"O and
1234 .BR usleep (3).
1235 .IP *
1236 .\"O .BR read (2)
1237 .\"O from an
1238 .\"O .BR inotify (7)
1239 .\"O file descriptor.
1240 .BR inotify (7)
1241 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1242 .BR read (2).
1243 .IP *
1244 .BR io_getevents (2).
1245 .RE
1246 .PP
1247 .\"O The
1248 .\"O .BR sleep (3)
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.
1251 .BR sleep (3)
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
1258 .\"O .BR EINTR
1259 .\"O after the process is stopped by one of the stop signals
1260 .\"O and then resumed via
1261 .\"O .BR SIGCONT .
1262 .\"O This behavior is not sanctioned by POSIX.1, and doesn't occur
1263 .\"O on other systems.
1264 Linux ¤Ç¤Ï¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
1265 ¤¤¤¯¤Ä¤«¤Î¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï¡¢
1266 ¥×¥í¥»¥¹¤¬°ì»þÄä»ß (stop) ¥·¥°¥Ê¥ë¤Î°ì¤Ä¤Ë¤è¤êÄä»ß¤µ¤ì¡¢
1267 .B SIGCONT
1268 ¤Ë¤è¤êºÆ³«¤µ¤ì¤¿¸å¤Ë¡¢¥¨¥é¡¼
1269 .B EINTR
1270 ¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
1271 ¤³¤ÎµóÆ°¤Ï POSIX.1 ¤Çǧ¤á¤é¤ì¤Æ¤ª¤é¤º¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ïµ¯¤³¤é¤Ê¤¤¡£
1272
1273 .\"O The Linux interfaces that display this behavior are:
1274 ¤³¤ÎµóÆ°¤ò¼¨¤¹ Linux ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¥¤¥¹¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
1275 .RS 4
1276 .IP * 2
1277 .\"O Socket interfaces, when a timeout has been set on the socket using
1278 .\"O .BR setsockopt (2):
1279 .\"O .BR accept (2),
1280 .\"O .BR recv (2),
1281 .\"O .BR recvfrom (2),
1282 .\"O and
1283 .\"O .BR recvmsg (2),
1284 .\"O if a receive timeout
1285 .\"O .RB ( SO_RCVTIMEO )
1286 .\"O has been set;
1287 .\"O .BR connect (2),
1288 .\"O .BR send (2),
1289 .\"O .BR sendto (2),
1290 .\"O and
1291 .\"O .BR sendmsg (2),
1292 .\"O if a send timeout
1293 .\"O .RB ( SO_SNDTIMEO )
1294 .\"O has been set.
1295 .BR setsockopt (2)
1296 ¤ò»È¤Ã¤Æ¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹:
1297 .BR accept (2),
1298 .BR recv (2),
1299 .BR recvfrom (2),
1300 .BR recvmsg (2)
1301 ¤Ç¼õ¿®¥¿¥¤¥à¥¢¥¦¥È
1302 .RB ( SO_RCVTIMEO )
1303 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤È¡¢
1304 .BR connect (2),
1305 .BR send (2),
1306 .BR sendto (2),
1307 .BR sendmsg (2)
1308 ¤ÇÁ÷¿®¥¿¥¤¥à¥¢¥¦¥È
1309 .RB ( SO_SNDTIMEO )
1310 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
1311 .IP * 2
1312 .BR epoll_wait (2),
1313 .BR epoll_pwait (2).
1314 .IP *
1315 .BR semop (2),
1316 .BR semtimedop (2).
1317 .IP *
1318 .BR sigtimedwait (2),
1319 .BR sigwaitinfo (2).
1320 .IP *
1321 .\"O .BR read (2)
1322 .\"O from an
1323 .\"O .BR inotify (7)
1324 .\"O file descriptor.
1325 .BR inotify (7)
1326 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é¤Î
1327 .BR read (2).
1328 .IP *
1329 .\"O Linux 2.6.21 and earlier:
1330 Linux 2.6.21 °ÊÁ°:
1331 .BR futex (2)
1332 .BR FUTEX_WAIT ,
1333 .BR sem_timedwait (3),
1334 .BR sem_wait (3).
1335 .IP *
1336 .\"O Linux 2.6.8 and earlier:
1337 Linux 2.6.8 °ÊÁ°:
1338 .BR msgrcv (2),
1339 .BR msgsnd (2).
1340 .IP *
1341 .\"O Linux 2.4 and earlier:
1342 Linux 2.4 °ÊÁ°:
1343 .BR nanosleep (2).
1344 .RE
1345 .\"O .SH "CONFORMING TO"
1346 .SH ½àµò
1347 .\"O POSIX.1, except as noted.
1348 POSIX.1 (Ãíµ­¤·¤¿ÆâÍưʳ°)¡£
1349 .\"O .SH BUGS
1350 .SH ¥Ð¥°
1351 .\"O .B SIGIO
1352 .\"O and
1353 .\"O .B SIGLOST
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
1357 .\"O signal 29 is
1358 .\"O .BR SIGLOST .
1359 .B SIGIO
1360 ¤È
1361 .B SIGLOST
1362 ¤ÏƱ¤¸Ãͤò»ý¤Ã¤Æ¤¤¤ë¡£
1363 .B SIGLOST
1364 ¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤Ç¤Ï¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤ë¡£
1365 ¤·¤«¤·¡¢¥½¥Õ¥È¥¦¥§¥¢¤Ë¤è¤Ã¤Æ¤Ï¥Ó¥ë¥É¤Î²áÄø¤Ç¥·¥°¥Ê¥ë 29 ¤ò
1366 .B SIGLOST
1367 ¤È¤ß¤Ê¤·¤Æ¤·¤Þ¤¦¤â¤Î¤¬¤¢¤ë¡£
1368 .\"O .SH "SEE ALSO"
1369 .SH ´ØÏ¢¹àÌÜ
1370 .BR kill (1),
1371 .BR getrlimit (2),
1372 .BR kill (2),
1373 .BR killpg (2),
1374 .BR rt_sigqueueinfo (2),
1375 .BR setitimer (2),
1376 .BR setrlimit (2),
1377 .BR sgetmask (2),
1378 .BR sigaction (2),
1379 .BR sigaltstack (2),
1380 .BR signal (2),
1381 .BR signalfd (2),
1382 .BR sigpending (2),
1383 .BR sigprocmask (2),
1384 .BR sigsuspend (2),
1385 .BR sigwaitinfo (2),
1386 .BR abort (3),
1387 .BR bsd_signal (3),
1388 .BR longjmp (3),
1389 .BR raise (3),
1390 .BR pthread_sigqueue (3),
1391 .BR sigqueue (3),
1392 .BR sigset (3),
1393 .BR sigsetops (3),
1394 .BR sigvec (3),
1395 .BR sigwait (3),
1396 .BR strsignal (3),
1397 .BR sysv_signal (3),
1398 .BR core (5),
1399 .BR proc (5),
1400 .BR pthreads (7),
1401 .BR sigevent (7)