Skip to content

Instantly share code, notes, and snippets.

@hank
Created October 11, 2012 23:49
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 hank/3876456 to your computer and use it in GitHub Desktop.
Save hank/3876456 to your computer and use it in GitHub Desktop.
#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