3 fork, rfork \- manipulate process resources
17 Forking is the only way new processes are created.
22 selects which resources of the
23 invoking process (parent) are shared
24 by the new process (child) or initialized to
28 the open file descriptor table (which, when shared, permits processes
29 to open and close files for other processes),
30 the set of environment variables
34 (the set of processes that receive notes written to a member's
39 the set of rendezvous tags
44 is the logical OR of some subset of
48 If set a new process is created; otherwise changes affect the
52 If set, the child process will be dissociated from the parent. Upon
53 exit the child will leave no
57 for the parent to collect.
60 If set, the new process inherits a copy of the parent's name space;
61 otherwise the new process shares the parent's name space.
62 Is mutually exclusive with
66 If set, the new process starts with a clean name space. A new
67 name space must be built from a mount of an open file descriptor.
68 Is mutually exclusive with
72 If set, subsequent mounts into the new name space and dereferencing
73 of pathnames starting with
78 If set, the environment variables are copied;
79 otherwise the two processes share environment variables.
80 Is mutually exclusive with
84 If set, the new process starts with an empty environment.
85 Is mutually exclusive with
89 Each process is a member of a group of processes that all
90 receive notes when a note is written to any of their
94 The group of a new process is by default the same as its parent, but if
98 the process becomes the first in a new group, isolated from
102 If set, the invoker's file descriptor table (see
104 is copied; otherwise the two processes share a
108 If set, the new process starts with a clean file descriptor table.
109 Is mutually exclusive with
113 If set, the process will be unable to
115 with any of its ancestors; its children will, however, be able to
119 makes the process the first in a group of processes that share a space for
124 If set, the child and the parent will share
129 Otherwise, the child inherits a copy of those segments.
130 Other segment types, in particular stack segments, will be unaffected.
135 File descriptors in a shared file descriptor table are kept
136 open until either they are explicitly closed
137 or all processes sharing the table exit.
142 value returned in the parent process
144 of the child process; the value returned in the child is zero.
147 the return value is zero.
148 Process ids range from 1 to the maximum integer
152 will sleep, if necessary, until required process resources are available.
156 .BR rfork(RFFDG|RFREND|RFPROC) .
158 .B /sys/src/libc/9syscall
160 .B /sys/src/libc/9sys/fork.c