.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)fork.3f 6.2 (Berkeley) 5/27/86
.TH FORK 3F "May 27, 1986"
fork \- create a copy of this process
.B integer function fork()
creates a copy of the calling process.
The only distinction between the 2 processes is that the value
returned to one of them (referred to as the `parent' process)
will be the process id of the copy.
The copy is usually referred to as the `child' process.
The value returned to the `child' process will be zero.
All logical units open for writing are flushed before the fork to avoid
duplication of the contents of I/O buffers in the external file(s).
If the returned value is negative, it indicates an error and will be
the negation of the system error code.
routine has not been provided because there is no satisfactory way to
retain open logical units across the exec.
However, the usual function of
A pipe can be opened to another process using the f77
.B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmread\(fm"
.B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmwrite\(fm"
.ie \nM /usr/ucb/lib/libU77.a
fork(2), wait(3F), kill(3F), system(3F), perror(3F)