This is used for creating a new process. The newly created process is called the child process, and it runs concurrently with the parent process. After executing the fork function, the execution of the program continues and the instruction following the fork function is executed by the parent as well as the child process. If the system call is successful, it will return a process ID of the child process and returns a 0 to the newly created child process. The function returns a negative value if the child process is not created.
Now, let's start with the first recipe for enabling communication between processes using pipes.