So, why the slide said "running in newly created child process" when the return value =0? Does it mean that the child process is not running when the return value>0? It said "running in parent process" when the return value>0.


Explanation:-
Fork() System call is used to create a new process, known as the child process. The fork is an operation where a process creates a copy of itself. The new copy is called the 'child process' while the original one is said 'parent process'.
After the creation of the new process both the processes(parent process and the child process) runs concurrently. Parent process makes the fork() call. When the new process is created, both the process follows or executes the same instruction which follows the fork() system call.
The use of fork() is to create a new process only. The child process uses the same files, registers, and program counter as the parent process.Fork() System call returns the value without taking parameters.
Step by step
Solved in 2 steps









