I want to create a tree of processes like this P0--->P1--->P2--->P3.
Asked
Active
Viewed 41 times
-3
-
if(fork()==0) inside an if(fork()==0) etc... – Samuel Khoury Nov 23 '14 at 15:00
1 Answers
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