Skip to content

Instantly share code, notes, and snippets.

@hank
Created Oct 11, 2012
Embed
What would you like to do?
#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