Why does this program print “forked!” 4 times?
The one comes from main() and the other three from every fork(). Notice that all three forks() are going to be executed. You might want to take a look at the ref: RETURN VALUE Upon successful completion, fork() shall return 0 to the child process and shall return the process ID of the child process … Read more