Oracle Solaris Studio 12.4 Man Pages

Exit Print View

Updated: January 2015
 
 

fork(3F)

Name

fork - create a copy of this process

Synopsis

integer*4 function fork()

Description

The fork function creates a copy of the calling process. The only distinction between the two processes is that the value returned to one of them, referred to as the 'parent' process, is the process id of the copy. The copy is usually referred to as the `child' process. The value returned to the `child' process is 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 files.

If the returned value is negative, it indicates an error and is the negation of the system error code. See perror(3F).

A corresponding exec routine has not been provided because there is no satisfactory way to retain open logical units across the exec. However, the usual function of fork/exec can be performed using system(3F).

Files

libfui.a

See also

fork(2), wait(3F), kill(3F), system(3F), perror(3F)