Creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0. File locks and pending signals are not inherited.
Arguments
Return values
If the system call succeeds the return value within the parent thread of execution is PID of the child process and within the child thread of execution is 0.
If the system call fails the return value is one of the following errno values:
-EAGAIN |
Cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
-or-
It was not possible to create a new process because the caller's RLIMIT_NPROC resource limit was encountered. To exceed this limit, the process must have either the CAP_SYS_ADMIN or the CAP_SYS_RESOURCE capability. |
-ENOMEM |
Failed to allocate the necessary kernel structures because due to memory limit. |
|
Remarks
All register values are passed to the child process.
See /samples/basic/fork.asm for an example.
Compatibility
n/a |