[Overview][Constants][Types][Procedures and functions][Variables][Index] | Reference for unit 'oldlinux' (#rtl)

# Fork

Create child process

## Declaration

Source position: oldlinux.pp line 1350

`function Fork: LongInt;`

## Description

Fork creates a child process which is a copy of the parent process. Fork returns the process ID in the parent process, and zero in the child's process. (you can get the parent's PID with GetPPid).

## Errors

On error, -1 is returned to the parent, and no child is created.

sys_eagain
  Not enough memory to create child process.

## See also

Execve |  | Execute process using environment
Clone |  | Clone current process (create new thread)

Documentation generated on: Feb 26 2014