]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/vfork.2
chroot.2: Added feature test macro requirements
[thirdparty/man-pages.git] / man2 / vfork.2
CommitLineData
fea681da
MK
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.
c13182ef 11.\"
fea681da
MK
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.
c13182ef 19.\"
fea681da
MK
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.\"
bd16963c 26.TH VFORK 2 2009-06-21 "Linux" "Linux Programmer's Manual"
fea681da
MK
27.SH NAME
28vfork \- create a child process and block parent
29.SH SYNOPSIS
30.B #include <sys/types.h>
31.br
32.B #include <unistd.h>
33.sp
34.B pid_t vfork(void);
cc4615cc
MK
35.sp
36.in -4n
37Feature Test Macro Requirements for glibc (see
38.BR feature_test_macros (7)):
39.in
40.sp
41.BR vfork ():
42_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
8c87824d
MK
43.SH DESCRIPTION
44.SS "Standard Description"
f9f81237 45(From POSIX.1)
fea681da 46The
bed66765 47.BR vfork ()
fea681da 48function has the same effect as
0bfa087b 49.BR fork (2),
d9bfdb9c 50except that the behavior is undefined if the process created by
bed66765 51.BR vfork ()
c13182ef
MK
52either modifies any data other than a variable of type
53.I pid_t
70cbdedf 54used to store the return value from
bed66765 55.BR vfork (),
fea681da 56or returns from the function in which
bed66765 57.BR vfork ()
fea681da 58was called, or calls any other function before successfully calling
0bfa087b 59.BR _exit (2)
fea681da 60or one of the
d806e103 61.BR exec (3)
fea681da 62family of functions.
8c87824d 63.SS "Linux Description"
bed66765 64.BR vfork (),
fea681da
MK
65just like
66.BR fork (2),
67creates a child process of the calling process.
68For details and return value and errors, see
69.BR fork (2).
70.PP
bed66765 71.BR vfork ()
fea681da
MK
72is a special case of
73.BR clone (2).
74It is used to create new processes without copying the page tables of
c13182ef 75the parent process.
600c9aa9 76It may be useful in performance-sensitive applications