Created
February 9, 2015 12:51
-
-
Save jaseg/db5b5e2d3411ae4a82cb 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 <unistd.h> | |
#include <sys/prctl.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
void hup_handler(int signal){ | |
exit(0); | |
} | |
int main(int argc, char **argv){ | |
signal(SIGHUP, hup_handler); | |
prctl(PR_SET_PDEATHSIG, SIGHUP); | |
while(42){ | |
pause(); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment