Skip to content

Instantly share code, notes, and snippets.

@dck
Created October 1, 2013 22:05
Show Gist options
  • Save dck/6785902 to your computer and use it in GitHub Desktop.
Save dck/6785902 to your computer and use it in GitHub Desktop.
If you want children to die when their parent exists..
#include <sys/prctl.h>
// pid = fork() and pid == 0
prctl(PR_SET_PDEATHSIG, SIGHUP);
// execv for example
// and the kernel will send SIGHUP to all childs if parent dies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment