Last active
December 15, 2015 08:49
-
-
Save chmullig/5233406 to your computer and use it in GitHub Desktop.
fork demo
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) { | |
fprintf(stderr, "Program starting with pid %d\n", getpid()); | |
pid_t forkvalue = fork(); | |
fprintf(stderr, "Fork returned %d in pid %d\n", forkvalue, getpid()); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment