Skip to content

Instantly share code, notes, and snippets.

@jaseg
Created February 9, 2015 12:51
Show Gist options
  • Save jaseg/db5b5e2d3411ae4a82cb to your computer and use it in GitHub Desktop.
Save jaseg/db5b5e2d3411ae4a82cb to your computer and use it in GitHub Desktop.
#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