Skip to content

Demo: fork() and exec() by Hand

Run

make
./fork_exec

Ask

  • fork() returns twice. How does each process tell which one it is?
  • Why does no code run after a successful execve() in the child's branch?