OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man2 / vfork.2
1 .\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl), 1 Nov 1999
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" 1999-11-10: Merged text taken from the page contributed by
24 .\" Reed H. Petty (rhp@draper.net)
25 .\"
26 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
27 .\"         all rights reserved.
28 .\" Translated 1999-12-04, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
29 .\" Updated 2007-01-09, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.43
30 .\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
31 .\"
32 .TH VFORK 2 2010-09-20 "Linux" "Linux Programmer's Manual"
33 .\"O .SH NAME
34 .SH Ì¾Á°
35 .\"O vfork \- create a child process and block parent
36 vfork \- »Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¿Æ¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤ë
37 .\"O .SH SYNOPSIS
38 .SH ½ñ¼°
39 .B #include <sys/types.h>
40 .br
41 .B #include <unistd.h>
42 .sp
43 .B pid_t vfork(void);
44 .sp
45 .in -4n
46 .\"O Feature Test Macro Requirements for glibc (see
47 .\"O .BR feature_test_macros (7)):
48 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
49 .RB ( feature_test_macros (7)
50 »²¾È):
51 .in
52 .sp
53 .BR vfork ():
54 .ad l
55 .RS 4
56 .PD 0
57 .TP 4
58 .\"O Since glibc 2.12:
59 glibc 2.12 °Ê¹ß:
60 .nf
61 _BSD_SOURCE ||
62     (_XOPEN_SOURCE\ >=\ 500 ||
63         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
64     !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
65 .fi
66 .TP 4
67 .\"O Before glibc 2.12:
68 glibc 2.12 ¤è¤êÁ°:
69 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
70 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
71 .PD
72 .RE
73 .ad b
74 .\"O .SH DESCRIPTION
75 .SH ÀâÌÀ
76 .\"O .SS "Standard Description"
77 .SS µ¬³Ê¤ÎÀâÌÀ
78 .\"O (From POSIX.1)
79 (POSIX.1 ¤è¤ê°úÍÑ)
80 .\"O The
81 .\"O .BR vfork ()
82 .\"O function has the same effect as
83 .\"O .BR fork (2),
84 .\"O except that the behavior is undefined if the process created by
85 .\"O .BR vfork ()
86 .\"O either modifies any data other than a variable of type
87 .\"O .I pid_t
88 .\"O used to store the return value from
89 .\"O .BR vfork (),
90 .\"O or returns from the function in which
91 .\"O .BR vfork ()
92 .\"O was called, or calls any other function before successfully calling
93 .\"O .BR _exit (2)
94 .\"O or one of the
95 .\"O .BR exec (3)
96 .\"O family of functions.
97 .BR vfork ()
98 ´Ø¿ô¤Ï
99 .BR fork (2)
100 ¤ÈƱ¤¸Æ¯¤­¤ò¤¹¤ë¤¬¡¢
101 .BR vfork ()
102 ¤ÇºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤¬
103 .BR vfork ()
104 ¤«¤é¤ÎÊÖ¤êÃͤò³ÊǼ¤·¤Æ¤¤¤ë
105 .I pid_t
106 ·¿¤ÎÊÑ¿ô°Ê³°¤òÊѹ¹¤·¤¿¤ê¡¢
107 .BR vfork ()
108 ¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë´Ø¿ô¤«¤é return ¤·¤¿¤ê¡¢
109 .BR _exit (2)
110 ¤ä
111 .BR exec (3)
112 ²¤Î´Ø¿ô¤ò¥³¡¼¥ë¤¹¤ëÁ°¤Ë¾¤Î´Ø¿ô¤ò¥³¡¼¥ë¤·¤¿¾ì¹ç¤ÎÆ°ºî¤¬
113 ̤ÄêµÁ¤Ç¤¢¤ë¤È¤¤¤¦ÅÀ¤¬°Û¤Ê¤ë¡£
114 .\"O .SS "Linux Description"
115 .SS "LINUX ¤Ç¤ÎÀâÌÀ"
116 .\"O .BR vfork (),
117 .\"O just like
118 .\"O .BR fork (2),
119 .\"O creates a child process of the calling process.
120 .\"O For details and return value and errors, see
121 .\"O .BR fork (2).
122 .BR vfork ()
123 ¤Ï
124 .BR fork (2)
125 ¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£
126 ¾Ü¤·¤¤ÀâÌÀ¤ÈÊÖ¤êÃÍ¡¢¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï
127 .BR fork (2)
128 ¤ò»²¾È¤¹¤ë¤³¤È¡£
129 .PP
130 .\"O .BR vfork ()
131 .\"O is a special case of
132 .\"O .BR clone (2).
133 .\"O It is used to create new processes without copying the page tables of
134 .\"O the parent process.
135 .\"O It may be useful in performance-sensitive applications
136 .\"O where a child is created which then immediately issues an
137 .\"O .BR execve (2).
138 .BR vfork ()
139 ¤Ï
140 .BR clone (2)
141 ¤ÎÆüì¤Ê¾ì¹ç¤Ç¤¢¤ë¡£
142 ¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤º¤Ë¿·¤·¤¤¥×¥í¥»¥¹¤ò
143 ºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤ì¤ÏÀ­Ç½¤ËÉÒ´¶¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤¤¤Æ
144 »Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¤Æ¤¹¤°¤Ë
145 .BR execve (2)
146 ¤¹¤ë¾ì¹ç¤ËÍ­ÍѤ«¤â¤·¤ì¤Ê¤¤¡£
147 .PP
148 .\"O .BR vfork ()
149 .\"O differs from
150 .\"O .BR fork (2)
151 .\"O in that the parent is suspended until the child terminates
152 .\"O (either normally,
153 .\"O by calling
154 .\"O .BR _exit (2),
155 .\"O or abnormally, after delivery of a fatal signal),
156 .\"O or it makes a call to
157 .\"O .BR execve (2).
158 .BR vfork ()
159 ¤Ï
160 .BR fork (2)
161 ¤È°ã¤¤¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«¡¢
162 .BR execve (2)
163 ¤ò¥³¡¼¥ë¤¹¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤òÄä»ß (suspend) ¤µ¤»¤ë¡£
164 »Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Ï¡¢
165 .BR _exit (2)
166 ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ëÄ̾ェλ¡¢
167 Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¸å¤Î°Û¾ï½ªÎ»¤ÎÆó¤Ä¤Î¥±¡¼¥¹¤¬¤¢¤ë¡£
168 .\"O Until that point, the child shares all memory with its parent,
169 .\"O including the stack.
170 .\"O The child must not return from the current function or call
171 .\"O .BR exit (3),
172 .\"O but may call
173 .\"O .BR _exit (2).
174 ¤³¤Î»þÅÀ¤Þ¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¥¹¥¿¥Ã¥¯¤ò´Þ¤àÁ´¤Æ¤Î¥á¥â¥ê¤ò
175 ¿Æ¥×¥í¥»¥¹¤È¶¦Í­¤¹¤ë¡£
176 »Ò¥×¥í¥»¥¹¤Ï¸½ºß¤Î´Ø¿ô¤«¤é return ¤·¤Æ¤Ï¤Ê¤é¤º¡¢
177 .BR exit (3)
178 ¤â¥³¡¼¥ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤¬¡¢
179 .BR _exit (2)
180 ¤Ê¤é¤Ð¥³¡¼¥ë¤·¤Æ¤â¤è¤¤¡£
181 .PP
182 .\"O Signal handlers are inherited, but not shared.
183 .\"O Signals to the parent
184 .\"O arrive after the child releases the parent's memory
185 .\"O (i.e., after the child terminates
186 .\"O or calls
187 .\"O .BR execve (2)).
188 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï·Ñ¾µ¤µ¤ì¤ë¤¬¡¢¶¦Í­¤Ï¤µ¤ì¤Ê¤¤¡£
189 ¿Æ¥×¥í¥»¥¹¤Ø¤Î¥·¥°¥Ê¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ò
190 ²òÊü¤·¤¿¸å (¤¹¤Ê¤ï¤Á¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«
191 .BR execve (2)
192 ¤ò¸Æ¤ó¤À¸å) ¤ËÅþÃ夹¤ë¡£
193 .\"O .SS "Historic Description"
194 .SS Îò»ËŪ¤ÊÀâÌÀ
195 .\"O Under Linux,
196 .\"O .BR fork (2)
197 .\"O is implemented using copy-on-write pages, so the only penalty incurred by
198 .\"O .BR fork (2)
199 .\"O is the time and memory required to duplicate the parent's page tables,
200 .\"O and to create a unique task structure for the child.
201 Linux ¤Ë¤ª¤¤¤Æ
202 .BR fork (2)
203 ¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) ¥Ú¡¼¥¸¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
204 ¤½¤Î¤¿¤á
205 .BR fork (2)
206 ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆÈï¤ë»³²¤Ï¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤ò
207 Ê£À½¤¹¤ë¤¿¤á¤ËɬÍפʻþ´Ö¤È¥á¥â¥ê¤À¤±¤Ç¤¢¤ë¡£
208 .\"O However, in the bad old days a
209 .\"O .BR fork (2)
210 .\"O would require making a complete copy of the caller's data space,
211 .\"O often needlessly, since usually immediately afterward an
212 .\"O .BR exec (3)
213 .\"O is done.
214 .\"O Thus, for greater efficiency, BSD introduced the
215 .\"O .BR vfork ()
216 .\"O system call, which did not fully copy the address space of
217 .\"O the parent process, but borrowed the parent's memory and thread
218 .\"O of control until a call to
219 .\"O .BR execve (2)
220 .\"O or an exit occurred.
221 .\"O The parent process was suspended while the
222 .\"O child was using its resources.
223 .\"O The use of
224 .\"O .BR vfork ()
225 .\"O was tricky: for example, not modifying data
226 .\"O in the parent process depended on knowing which variables were
227 .\"O held in a register.
228 ¤·¤«¤·¤Ê¤¬¤é¡¢´÷¤·¤­ÀΤˤÏ
229 .BR fork (2)
230 ¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¶õ´Ö¤ÎÁ´¤Æ¤Î¥³¥Ô¡¼¤·¤Æ¤¤¤¿¤¬¡¢
231 ¤³¤ì¤Ï¤·¤Ð¤·¤ÐÉÔɬÍפǤ¢¤Ã¤¿¡£¤Ê¤¼¤Ê¤é¡¢¤¿¤¤¤Æ¤¤¤Ï¤¹¤°¸å¤Ë
232 .BR exec (3)
233 ¤ò¼Â¹Ô¤·¤Æ¤¤¤¿¤«¤é¤Ç¤¢¤ë¡£
234 ¤³¤Î¾ì¹ç¤Î¸úΨ¤ò¾å¤²¤ë¤¿¤á¤Ë BSD ¤Ï
235 .BR vfork ()
236 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òƳÆþ¤·¤Æ¿Æ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´°Á´¤Ë¥³¥Ô¡¼
237 ¤¹¤ë¤«¤ï¤ê¤Ë¡¢
238 .BR execve (2)
239 ¤ò¥³¡¼¥ë¤¹¤ë¤« exit ¤¬µ¯¤­¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ÈÀ©¸æ¥¹¥ì¥Ã¥É
240 ¤ò¼Ú¤ê¤ë¤è¤¦¤Ë¤·¤¿¡£
241 ¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤¬¤½¤Î»ñ¸»¤ò»ÈÍѤ·¤Æ¤¤¤ë´Ö¤ÏÄä»ß¤µ¤ì¤¿¡£
242 .BR vfork ()
243 ¤Ï»È¤¤¤Ë¤¯¤¤¤â¤Î¤Ç¤¢¤Ã¤¿: Î㤨¤Ð¡¢¿Æ¥×¥í¥»¥¹¤ÎÊÑ¿ô¤òÊѹ¹¤·¤Ê
244 ¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¤É¤ÎÊÑ¿ô¤¬¥ì¥¸¥¹¥¿¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤé¤Ê
245 ¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£
246 .\"O .SH "CONFORMING TO"
247 .SH ½àµò
248 4.3BSD, POSIX.1-2001.
249 .\"O POSIX.1-2008 removes the specification of
250 .\"O .BR vfork ().
251 POSIX.1-2008 ¤Ç¤Ï¡¢
252 .BR vfork ()
253 ¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
254 .\"O The requirements put on
255 .\"O .BR vfork ()
256 .\"O by the standards are weaker than those put on
257 .\"O .BR fork (2),
258 .\"O so an implementation where the two are synonymous is compliant.
259 .\"O In particular, the programmer cannot rely on the parent
260 .\"O remaining blocked until the child either terminates or calls
261 .\"O .BR execve (2),
262 .\"O and cannot rely on any specific behavior with respect to shared memory.
263 .BR vfork ()
264 ¥³¡¼¥ë¤Ï¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤ÎƱ̾¤Î¥³¡¼¥ë¤È
265 ¤Á¤ç¤Ã¤È»÷¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£µ¬³Ê¤¬
266 .BR vfork ()
267 ¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤Ï¡¢
268 .BR fork (2)
269 ¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤è¤ê¤Ï¼å¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢
270 ξ¼Ô¤òƱ¤¸¤â¤Î¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤â¡¢µ¬³Ê¤Ë½àµò¤·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¡£
271 ÆÃ¤Ë¥×¥í¥°¥é¥Þ¡¼¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«
272 .BR execve (2)
273 ¤ò¸Æ¤Ó½Ð¤¹¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë¤³¤È¤ä¡¢¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³
274 ¤È¤Ë¤è¤ëÆüì¤ÊÆ°ºî¤ò¤¢¤Æ¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
275 .\" In AIXv3.1 vfork is equivalent to fork.
276 .\"O .SH NOTES
277 .\"O .SS Linux Notes
278 .SH Ãí°Õ
279 .SS Linux ¤Ç¤ÎÃí°Õ
280 .\"O Fork handlers established using
281 .\"O .BR pthread_atfork (3)
282 .\"O are not called when a multithreaded program employing
283 .\"O the NPTL threading library calls
284 .\"O .BR vfork ().
285 .\"O Fork handlers are called in this case in a program using the
286 .\"O LinuxThreads threading library.
287 .\"O (See
288 .\"O .BR pthreads (7)
289 .\"O for a description of Linux threading libraries.)
290 .BR pthread_atfork (3)
291 ¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤¿ fork ¥Ï¥ó¥É¥é¤Ï
292 NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤òºÎÍѤ·¤¿¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï
293 ¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£°ìÊý¡¢LinuxThreads ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤¿
294 ¥×¥í¥°¥é¥à¤Ç¤Ï¡¢fork ¥Ï¥ó¥É¥é¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¡£
295 (Linux ¤Î¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ÎÀâÌÀ¤Ï
296 .BR pthreads (7)
297 ¤ò»²¾È¡£)
298 .\"O .SS History
299 .SS Îò»Ë
300 .\"O The
301 .\"O .BR vfork ()
302 .\"O system call appeared in 3.0BSD.
303 .BR vfork ()
304 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 3.0BSD ¤Ë¸½¤ï¤ì¤¿¡£
305 .\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still
306 .\" present, but definitely on its way out'.
307 .\"O In 4.4BSD it was made synonymous to
308 .\"O .BR fork (2)
309 .\"O but NetBSD introduced it again,
310 .\"O cf. http://www.netbsd.org/Documentation/kernel/vfork.html .
311 4.4BSD ¤Ë¤ª¤¤¤Æ
312 .BR fork (2)
313 ¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤¿¤¬¡¢NetBSD ¤Ç¤ÏºÆ¤ÓƳÆþ¤µ¤ì¤¿¡£
314 http://www.netbsd.org/Documentation/kernel/vfork.html ¤ò»²¾È¡£
315 .\"O In Linux, it has been equivalent to
316 .\"O .BR fork (2)
317 .\"O until 2.2.0-pre6 or so.
318 .\"O Since 2.2.0-pre9 (on i386, somewhat later on
319 .\"O other architectures) it is an independent system call.
320 .\"O Support was added in glibc 2.0.112.
321 Linux ¤Ç¤Ï 2.2.0-pre6 ¤¢¤¿¤ê¤Þ¤Ç¤Ï
322 .BR fork (2)
323 ¤ÈÅù²Á¤Ç¤¢¤Ã¤¿¡£(i386 ¤Ç¤Ï) 2.2.0-pre9 ¤«¤é (¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï
324 ¾¯¤·ÃÙ¤ì¤Æ) ÆÈΩ¤·¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤¿¡£
325 glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc-2.0.112 ¤ÇÄɲ䵤줿¡£
326 .\"O .SH BUGS
327 .SH ¥Ð¥°
328 .\"O It is rather unfortunate that Linux revived this specter from the past.
329 .\"O The BSD man page states:
330 .\"O "This system call will be eliminated when proper system sharing mechanisms
331 .\"O are implemented.
332 .\"O Users should not depend on the memory sharing semantics of
333 .\"O .BR vfork ()
334 .\"O as it will, in that case, be made synonymous to
335 .\"O .BR fork (2).\c
336 .\"O "
337 Linux ¤¬¤³¤Î²áµî¤ÎË´Îî¤òÉü³è¤µ¤»¤¿¤³¤È¤Ï¡¢¤à¤·¤íÉÔ¹¬¤È¸À¤¦¤Ù¤­¤Ç¤¢¤ë¡£
338 BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¡¢
339 ¡Ö¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÂÅÅö¤Ê¥·¥¹¥Æ¥à¶¦Í­µ¡¹½¤¬¼ÂÁõ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï
340 ºï½ü¤µ¤ì¤ë¡£¥æ¡¼¥¶¤Ï
341 .BR vfork ()
342 ¤Î¥á¥â¥ê¶¦Í­µ¡Ç½¤Ë°Í¸¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£²¿¸Î¤Ê¤é¤Ð¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë
343 ¤¬ºï½ü¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤Ï
344 .BR fork (2)
345 ¤ÎƱµÁ¸ì¤È¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£
346
347 .\"O Details of the signal handling are obscure and differ between systems.
348 .\"O The BSD man page states:
349 .\"O "To avoid a possible deadlock situation, processes that are children
350 .\"O in the middle of a
351 .\"O .BR vfork ()
352 .\"O are never sent
353 .\"O .B SIGTTOU
354 .\"O or
355 .\"O .B SIGTTIN
356 .\"O signals; rather, output or
357 .\"O .IR ioctl s
358 .\"O are allowed and input attempts result in an end-of-file indication."
359 ¥·¥°¥Ê¥ë¤Î°·¤¤¤Î¾ÜºÙ¤ÏÉÔÌÀÎƤǥ·¥¹¥Æ¥à¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£
360 BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¡¢
361 ¡Ö¥Ç¥Ã¥É¥í¥Ã¥¯¾õÂ֤ˤʤë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç
362 .BR vfork ()
363 ¤ÎÅÓÃæ¤Î»Ò¥×¥í¥»¥¹¤Ë
364 .B SIGTTOU
365 ¤ä
366 .B SIGTTIN
367 ¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤;
368 ¤µ¤é¤Ë½ÐÎϤä
369 .I ioctl
370 ¤Ïµö¤µ¤ì¤ë¤¬¡¢ÆþÎϤò»î¤ß¤¿¾ì¹ç¤Ë¤Ï·ë²Ì¤Ï¥Õ¥¡¥¤¥ë½ªÃ¼ (EOF) ¤Ë¤Ê¤ë¡£¡×
371 ¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£
372 .\"
373 .\" As far as I can tell, the following is not true in 2.6.19:
374 .\"O .\" Currently (Linux 2.3.25),
375 .\"O .\" .BR strace (1)
376 .\"O .\" cannot follow
377 .\"O .\" .BR vfork ()
378 .\"O .\" and requires a kernel patch.
379 .\" ¸½ºß¤Î¤È¤³¤í (Linux 2.3.25)¡¢
380 .\" .BR strace (1)
381 .\" ¤Ï
382 .\" .BR vfork ()
383 .\" ¤òÄÉÀפ¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬É¬ÍפǤ¢¤ë¡£
384 .\"O .SH "SEE ALSO"
385 .SH ´ØÏ¢¹àÌÜ
386 .BR clone (2),
387 .BR execve (2),
388 .BR fork (2),
389 .BR unshare (2),
390 .BR wait (2)