日期:2014-05-16 浏览次数:20810 次
NAME
vfork - create a child process and block parent
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
pid_t vfork(void);
STANDARD DESCRIPTION
(From XPG4 / SUSv2 / POSIX draft.) The vfork() function has the same effect as fork(), except that the behaviour is undefined if the process created by
vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which
vfork() was called, or calls any other function before successfully calling _exit() or one of the exec family of functions.
ERRORS
EAGAIN Too many processes - try again.
ENOMEM There is insufficient swap space for the new process.
LINUX DESCRIPTION
vfork, just like fork(2), creates a child process of the calling process. For details and return value and errors, see fork(2).
vfork() is a special case of clone(2). It is used to create new processes without copying the page tables of the parent process. It may be useful in per-
formance sensitive applications where a child will be created which then immediately issues an execve().
vfork() differs from fork in that the parent is suspended until the child makes a ca