Manual Reference Pages - RFORK (3)
rfork - manipulate process state
int rfork(int flags)
Rfork is a partial implementation of the Plan 9 system call.
It can be used to manipulate some process state and to create
new processes a la
It cannot be used to create shared-memory processes
RFMEM flag); for that functionality use
flags argument to
rfork selects which resources of the
invoking process (parent) are shared
by the new process (child) or initialized to
their default values.
Flags is the logical OR of some subset of
File descriptors in a shared file descriptor table are kept
open until either they are explicitly closed
or all processes sharing the table exit.
If set a new process is created; otherwise changes affect the
If set, the child process will be dissociated from the parent. Upon
exit the child will leave no
for the parent to collect.
Each process is a member of a group of processes that all
receive notes when a note is sent to the group
The group of a new process is by default the same as its parent, but if
RFNOTEG is set (regardless of
RFPROC), the process becomes the first in a new group, isolated from
In Plan 9, a process can call
rfork(RFNOTEG) and then be sure that it will no longer receive console interrupts
or other notes.
Unix job-control shells put each command in its own process group
and then relay notes to the current foreground command, making
the idiom less useful.
If set, the invokers file descriptor table (see
intro()) is copied; otherwise the two processes share a
RFPROC is set, the
value returned in the parent process
is the process id
of the child process; the value returned in the child is zero.
RFPROC, the return value is zero.
Process ids range from 1 to the maximum integer
Rfork will sleep, if necessary, until required process resources are available.
rfork(RFFDG|RFPROC) is equivalent to calling
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.