File: vfork.2

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (193 lines) | stat: -rw-r--r-- 5,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl), 1 Nov 1999
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" 1999-11-10: Merged text taken from the page contributed by
.\" Reed H. Petty (rhp@draper.net)
.\"
.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
.\"         all rights reserved.
.\" Translated Sat Dec  4 00:13:33 JST 1999
.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.TH VFORK 2 "1 Nov 1999" "Linux 2.2.0" "Linux Programmer's Manual"
.SH ̾
vfork \- ҥץƥץߤ
.SH 
.B #include <sys/types.h>
.br
.B #include <unistd.h>
.sp
.B pid_t vfork(void);
.SH ʤ
(XPG4 / SUSv2 / POSIX ɥեȤ)
.IR vfork ()
ؿ
.IR fork ()
ƱƯ򤹤뤬
.IR vfork ()
Ǻ줿ץ
.IR vfork ()
֤ͤǼƤ pid_t ѿʳѹꡢ
.IR vfork ()
ƤӽФƤؿ return ꡢ
.IR _exit ()

.I exec
²δؿ򥳡뤹¾δؿ򥳡뤷ư
̤ǤȤǰۤʤäƤ롣
.SH 顼
.TP
.B EAGAIN
ץ¿᤮ - ƻԤ뤳ȡ
.TP
.B ENOMEM
ץ뤿Υåΰ褬ʬˤʤ
.SH "LINUX "
.BR vfork 

.BR fork (2)
Ʊ褦˸ƤӽФץλҥץ롣
ܤ֤͡顼ˤĤƤ
.BR fork (2)
򻲾Ȥ뤳ȡ
.PP
.B vfork()

.BR clone (2)
üʾǤ롣
ƥץΥڡơ֥ΥԡԤ鷺˿ץ
뤿˻Ѥ롣ǽҴʥץꥱˤ
ҥץƤ
.IR execve() 
ͭѤ⤷ʤ
.PP
.B vfork()
 fork Ȱäƻҥץ
.BR execve (2)
ޤ
.BR _exit (2)
򥳡뤹ޤǿƥץ(suspend)롣
ҥץ
.I execve()
¹ԤޤǤϥåޤƤΥƥץȶͭƤ롣
ҥץϸߤδؿ return ƤϤʤʤޤҥץ
.IR exit()
򥳡뤷ƤϤʤ餤
.IR _exit()
ʤХ뤷Ƥ褤
.PP
ʥ롦ϥɥϷѾƤ뤬ͭϤƤʤ
ƥץؤΥʥϻҥץƤ夹롣
.SH Ū
Linux ˤ
.IR fork ()
Ͻ񤭹߻ԡ(copy-on-write)ڡѤƼƤ롣
Τ
.IR fork ()
Ѥ뤳Ȥˤä»ϿƥץΥڡơ֥
ʣ뤿ɬפʻ֤ȥǤ롣
ʤΤˤ
.IR fork()
ϸƤӽФץΥǡ֤ƤΥԡƤ
ϤФɬפǤäʤʤϤ˸
.IR exec ()
¹ԤƤǤ롣
ξθΨ夲뤿 BSD 
.B vfork
ƥॳƳƿƥץΥɥ쥹֤˥ԡ
뤫ˡ
.IR execve ()
򥳡뤹뤫 exit ޤǿƥץΥ楹å
ڤ褦ˤ
ƥץϻҥץλ񸻤ѤƤ֤ߤƤ롣
vfork λѤϥȥåǤ롣㤨пƥץѿѹ
褦ˤ뤿ˤϤɤѿ쥸ݻƤ뤫Τ
Фʤʤ
.SH Х
Linux β˴褵ȤϡषԹȸ٤Ǥ롣
BSD Υޥ˥奢ˤ:
֤Υƥॳʥƥඦͭ줿ˤ
롣桼
.I vfork
Υ궦ͭǽ˰¸٤ǤϤʤΤʤСΥƥॳ
줿ˤϡ
.IR fork
ƱȤ뤫Ǥ롣

̩˸ȡ嵭ɸεҤǤ
.IR vfork ()
ѤƤϤʤȤˤʤ롣ʤʤ
.IR exec
ϼԤ뤫⤷줺ξư̤Ǥ롣

ʥ롦ϥɥ󥰤ξܺ٤ƤǥƥऴȤ˰ۤäƤ롣
BSD Υޥ˥奢ˤ:
֥ǥåɥå֤ˤʤǽΤ
.I vfork
λҥץ SIGTTOU  SIGTTIN ʥƤϤʤʤ;
˽Ϥ
.IR ioctl
ϵ뤬ϤߤˤϷ̤ϥե뽪ü(EOF)ˤʤ롣


ߤΤȤ(Linux 2.3.25)
.BR strace (1)

.IR vfork()
פ뤳ȤǤͥѥåɬפǤ롣
.SH 
.IR vfork ()
ƥॳ 3.0BSD ˸줿
.\" In the release notes for BSD 4.2 Sam Leffler wrote: `vfork: Is still
.\" present, but definitely on its way out'.
BSD 4.4 ˤ
.IR fork ()
ƱȤʤäNetBSD ϺƤӤƳ
http://www.netbsd.org/Documentation/kernel/vfork.html 򻲾ȡ
Linux Ǥ 2.2.0-pre6 ޤǤ
.IR fork ()
Ǥä2.2.0-pre9 (i386 Ǥϡ¾ΥƥǤ
٤)ΩƥॳȤʤäݡȤ glibc-2.0.112
ɲä줿

.SH 
.\" In AIXv3.1 vfork is equivalent to fork.
.B vfork
¾Υڥ졼ƥ󥰡ƥƱ̾Υ
äȻƤ뤫⤷ʤʤ
.B vfork
׵ᤷƤ뤳Ȥϡ
.BR fork 
׵ᤷƤ뤳Ȥϼ夤
ξԤƱΤȤƼƤŬˤʤ롣
ä˥ץޡ
.I execve()
ޤ
.I _exit()
¹ԤޤǿƥץߤƤ뤳Ȥ䡢ͭ뤳
Ȥˤüư򤢤Ƥˤ٤ǤϤʤ

.SH Ϣ
.BR clone (2),
.BR execve (2),
.BR fork (2),
.BR wait (2)