Skip to content

Instantly share code, notes, and snippets.

@shinkwhek
Created May 9, 2017 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinkwhek/5264a1b055eaabbb1df25177dfaf1092 to your computer and use it in GitHub Desktop.
Save shinkwhek/5264a1b055eaabbb1df25177dfaf1092 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
int main (void) {
printf("1\n");
pid_t A = fork();
printf("fork():%d\n",A);
printf("pid:%d\n",getpid());
if(A==0)
printf("a\n");
else
printf("b\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment