Skip to content

Instantly share code, notes, and snippets.

@chmullig
Last active December 15, 2015 08:49
Show Gist options
  • Save chmullig/5233406 to your computer and use it in GitHub Desktop.
Save chmullig/5233406 to your computer and use it in GitHub Desktop.
fork demo
#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