#[unsafe(no_mangle)]pub extern "C" fn sys_fork() -> i32
Available on crate feature
export-syscalls
only.Expand description
sys_fork()
creates a new process by duplicating the calling process. The
new process is referred to as the child process. The calling process is
referred to as the parent process.
The child process and the parent process run in separate memory spaces. At
the time of sys_fork()
both memory spaces have the same content.
ยงReturn Value
On success, the PID of the child process (1) is returned in the parent, and 0 is returned in the child. On failure, -1 is returned in the parent, no child process is created.