Skip to content

Instantly share code, notes, and snippets.

@ywkw1717
Created May 28, 2017 22:37
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 ywkw1717/16332f539dc05d232657b4b2295245d4 to your computer and use it in GitHub Desktop.
Save ywkw1717/16332f539dc05d232657b4b2295245d4 to your computer and use it in GitHub Desktop.
seccamp A-4 fork
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
int main(){
pid_t pid;
pid = fork();
if(pid == -1){
printf(“failed. errorno:%d\n”, errno);
return 1;
} else if(pid == 0){
printf(“child\n”);
printf("%d\n", pid);
} else{
printf(“parent\n”);
printf("%d\n", pid);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment