-
-
Save ywkw1717/16332f539dc05d232657b4b2295245d4 to your computer and use it in GitHub Desktop.
seccamp A-4 fork
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 <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