"The fork() system call creates a new process by duplicating the calling process. The new process is referred to as the child process and 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 fork() both memory spaces have the same content” (Linux Manual Page)
Let’s dissect fork()'s function declaration:
pid_t is a data type (a signed 32 bit integer) that represents a process ID, usually referred to as a "PID". Every process has a unique PID, therefore, the parent and child processes each have their own unique PIDs. When called within the parent process, fork() returns the PID of the child process on success and when called within the child process, fork() returns 0 on success. On failure, -1 is returned in the parent, no child process is created, and errno is set to indicate the error.