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

Fork

Create child process

Declaration

Source position: oldlinux.pp line 1350

function Fork: LongInt;

Description

Forkcreates a child process which is a copy of the parent process. Forkreturns 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)