Section: Linux Programmer's Manual (2)
Return to Main Contents
fork - create a child process
creates a child process that differs from the parent process only in its
PID and PPID, and in the fact that resource utilizations are set to 0.
File locks and pending signals are not inherited.
is implemented using copy-on-write pages, so the only penalty that it incurs
is the time and memory required to duplicate the parent's page tables,
and to create a unique task structure for the child.
On success, the PID of the child process is returned in the parent's thread
of execution, and a 0 is returned in the child's thread of execution. On
failure, a -1 will be returned in the parent's context, no child process
will be created, and
will be set appropriately.
cannot allocate sufficient memory to copy the parent's page tables and
allocate a task structure for the child.
It was not possible to create a new process because the caller's
resource limit was encountered.
To exceed this limit, the process must have either the
failed to allocate the necessary kernel structures because memory is tight.
SVr4, 4.3BSD, POSIX.1-2001.
- RETURN VALUE
- CONFORMING TO
- SEE ALSO
linux.jgfs.net manual pages