-3

I want to create a tree of processes like this P0--->P1--->P2--->P3.

1 Answers1

0

Each parent process is not allowed to terminate before its child process

Make the parent wait() on its child's end.

See also: Make parent wait for all child processes

Community
  • 1
  • 1
alk
  • 69,737
  • 10
  • 105
  • 255