Commit | Line | Data |
---|---|---|
3b9e8f30 C |
1 | .TH FORK 3F "13 June 1983" |
2 | .UC 4 | |
3 | .SH NAME | |
4 | fork \- create a copy of this process | |
5 | .SH SYNOPSIS | |
6 | .B integer function fork() | |
7 | .SH DESCRIPTION | |
8 | .I Fork | |
9 | creates a copy of the calling process. | |
10 | The only distinction between the 2 processes is that the value | |
11 | returned to one of them (referred to as the 'parent' process) | |
12 | will be the process id if the copy. | |
13 | The copy is usually referred to as the 'child' process. | |
14 | The value returned to the 'child' process will be zero. | |
15 | .PP | |
16 | All logical units open for writing are flushed before the fork to avoid | |
17 | duplication of the contents of I/O buffers in the external file(s). | |
18 | .PP | |
19 | If the returned value is negative, it indicates an error and will be | |
20 | the negation of the system error code. | |
21 | See perror(3F). | |
22 | .PP | |
23 | A corresponding | |
24 | .I exec | |
25 | routine has not been provided because there is no satisfactory way to | |
26 | retain open logical units across the exec. | |
27 | However, the usual function of | |
28 | .I fork/exec | |
29 | can be performed using | |
30 | .IR system (3F). | |
31 | .if 0 \{ | |
32 | A pipe can be opened to another process using the f77 | |
33 | .B open | |
34 | statement with | |
35 | .sp 1 | |
36 | .ti +5 | |
37 | .B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmread\(fm" | |
38 | .br | |
39 | or | |
40 | .br | |
41 | .ti +5 | |
42 | .B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmwrite\(fm" | |
43 | \} | |
44 | .SH FILES | |
45 | .ie \nM /usr/ucb/lib/libU77.a | |
46 | .el /usr/lib/libU77.a | |
47 | .SH "SEE ALSO" | |
48 | fork(2), wait(3F), kill(3F), system(3F), perror(3F) |