File:  [Research Unix] / researchv10dc / dist / man / v4 / man2 / fork.2
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

.th FORK II 8/5/73
.sh NAME
fork  \*-  spawn new process
.sh SYNOPSIS
(fork = 2.)
.br
.ft B
sys fork
.br
.ft R
(new process return)
.br
(old process return)
.s3
.ft B
fork( )
.ft R
.sh DESCRIPTION
.it Fork
is the only way new processes are created.
The new process's core image is a copy of
that of the caller of
.it fork.
The only distinction
is the return location and the fact
that r0 in the old (parent) process contains the process ID
of the new (child) process.
This process ID is used by
.it wait.
.s3
From C, the returned value is 0 in the child process,
non-zero in the parent process; however,
a return of \*-1 indicates inability
to create a new process.
.sh "SEE ALSO"
wait(II), exec(II)
.sh DIAGNOSTICS
The error bit
(c-bit) is set in the old process if a new process
could not be created because of lack of process space.
From C, a return of \*-1 (not just negative)
indicates an error.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.