Created
October 15, 2015 00:33
-
-
Save Grumblesaur/025bf578a64f2be7c48d to your computer and use it in GitHub Desktop.
Found in a classmate's shell program's main loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forknum = fork(); | |
if(forknum == 0){ | |
fprintf(stderr, "parent "); | |
wait(&childstatus); | |
} | |
else{ | |
fprintf(stderr, "child "); | |
childstatus = 0; | |
exit(childstatus); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment