1FORK(2)                       System Calls Manual                      FORK(2)
2
3
4

NAME

6       fork  -  spawn new process
7

SYNOPSIS

9       fork( )
10

DESCRIPTION

12       Fork is the only way new processes are created.  The new process's core
13       image is a copy of that of the caller of fork.  The only distinction is
14       the  fact  that the value returned in the old (parent) process contains
15       the process ID of the new (child) process, while the value returned  in
16       the  child is 0.  Process ID's range from 1 to 30,000.  This process ID
17       is used by wait(2).
18
19       Files open before the fork are shared, and  have  a  common  read-write
20       pointer.  In particular, this is the way that standard input and output
21       files are passed and also how pipes are set up.
22

SEE ALSO

24       wait(2), exec(2)
25

DIAGNOSTICS

27       Returns -1 and fails to create a process if: there is  inadequate  swap
28       space,  the  user  is not super-user and has too many processes, or the
29       system's process table is full.  Only the super-user can take the  last
30       process-table slot.
31

ASSEMBLER

33       (fork = 2.)
34       sys fork
35       (new process return)
36       (old process return, new process ID in r0)
37
38       The  return  locations  in  the old and new process differ by one word.
39       The C-bit is set in the old process if a new process could not be  cre‐
40       ated.
41
42
43
44                                                                       FORK(2)
Impressum