Fork, exec, zombies and orphans
Follow a shell as it forks a child, replaces the child's program, collects the child's exit status, and finally adopts a child left behind. Processes and threads · Operating systems.
A shell starts a command, keeps running itself, and still learns how the command ended. Follow the calls that make that possible.
What you will learn
- Read the two return values of fork and say what each process now holds
- Tell exec, which swaps a program, from fork, which makes a process
- Say who reaps a zombie and who adopts an orphan
Lesson outline
- One call, two processes
- A new program in the same process
- What a finished child leaves behind
- When the parent exits first
15 minutes · 4 scenes · 0 predict checks · 10 quiz questions
The full lesson is available with Premium.