Fork Parent Child Code
Fork Parent Child Code Execution Blocks
fork() will return -1 (to the would-be parent) if the fork doesn’t work. if((pid = fork()) < 0){ //some sort of error occurred }else{ if(pid == 0){ //child goes on from here }else{ //parent goes on from here } }
Source: http://www.cs.brown.edu/courses/cs036/labs/syscall.pdf
page revision: 0, last edited: 26 May 2008 09:04