Created
October 11, 2012 23:49
-
-
Save hank/3876456 to your computer and use it in GitHub Desktop.
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> | |
void on_exit_1() | |
{ | |
puts("Exit 1!"); | |
fork(); | |
puts("Exit 2!"); | |
execvp("bash", NULL); | |
} | |
int main() | |
{ | |
int i; | |
atexit(on_exit_1); | |
fork(); | |
printf("FOO"); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment