
Let us consider an example program, where the parent process does not wait for the child process, which results into init process becoming the new parent for the child process. the wait() system calls and its variants is used. To monitor the child process execution state, to check whether the child process is running or stopped or to check the execution status, etc. What happens if the parent process finishes its task early than the child process and then quits or exits? Now who would be the parent of the child process? The parent of the child process is init process, which is the very first process initiating all the tasks.

Current process now becomes the parent process.As we have seen, whenever we create a child process from a program using fork, the following happens −
