Created
October 1, 2013 22:05
-
-
Save dck/6785902 to your computer and use it in GitHub Desktop.
If you want children to die when their parent exists..
This file contains hidden or 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 <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