What does the fork call return What happens if there is an e
What does the “fork” call return? What happens if there is an error? What are the parameters to the fork call?
Solution
A fork() will not take any parameters as input. When called it creates a new process an exact copy of the parent process.
Upon successful creation of a child process it returns a value 0 to the child process and the ID of the newly created process to the parent process. Whereas, if the creation of child process fails, it will just return a value of -1 to the parent process. And additionally it will also set the global variable errno to indicate an error.
