in reply to Re^3: fork(): when parent exits, what happens to child?
in thread fork(): when parent exits, what happens to child?

So then the rule is: when a parent terminates, the child keeps on executing.

Indeed, you've forked a new process, but well behaved parents wait (or waitpid) on their children so they don't turn into zombies.

  • Comment on Re^4: fork(): when parent exits, what happens to child?