previous | start | next

Waiting for a Child Process

A shell program reads a command with 0 or more arguments and creates a child process to execute the command.

The default is for the shell to wait for the command execution to finish; that is, to wait for the child process to terminate.

However, in Linux if the command line ends with &, the shell doesn't wait. The shell prints a prompt and handles another command while the first command executes in the background.

In this latter case, the shell has the responsibility to let the operating system know that all the information about the child can finally be discarded. Otherwise, the operating system keeps the following information:

This information is retained in the operating system's process table entry for the child.

Freeing this entry and discarding the child information is called reaping the process.



previous | start | next