Function process

fork

fork () function is used to create a new process from a process that already exists, the new process is called the child process, and the original process is called the parent process.

Points Explanation
The required header files #include <sys / types.h> / provide type definition pid_t /
#include <unistd.h>
Function prototype pid_t fork(void)
Function return value 0: child process
pid child processes: the parent
-1: Error

Guess you like

Origin www.cnblogs.com/xzj8023tp/p/11230539.html