FORK(2) HP Integral PC FORK(2) FORK(2) HP Integral PC FORK(2) FORK(2) HP Integral PC FORK(2) FORK(2) HP Integral PC FORK(2) NAME NAME NAME NAME fork - create a new process SYNOPSIS SYNOPSIS SYNOPSIS SYNOPSIS int fork () DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION Fork causes creation of a new process. The new process (child process) is an exact copy of the calling process (parent process) except for the following: The child process has a unique process ID. The child process has a different parent process ID (i.e., the process ID of the parent process). The child process has its own copy of the parent's file descriptors. Each of the child's file descriptors shares a common file pointer with the corresponding file descriptor of the parent. The child process's utime , " stime" , " cutime" , and cstime are set to 0 ; see times (2). Fork returns a value of 0 to the child process. Fork returns the process ID of the child process to the parent process. Fork will fail and no child process will be created if one or more of the following are true: The system-imposed limit on the total number of processes under execution would be exceeded. [EAGAIN] The system-imposed limit on the total number of processes under execution by a single user would be exceeded. [EAGAIN] RETURN VALUE RETURN VALUE RETURN VALUE RETURN VALUE Upon successful completion, fork returns a value of 0 to the child process and returns the process ID of the child process to the parent process. Otherwise, a value of -1 is returned to the parent process, no child process is created, and errno is set to indicate the error. SEE ALSO SEE ALSO SEE ALSO SEE ALSO exec(2), wait(2). Hewlett-Packard - 1 - (printed 12/11/84)