Created
November 18, 2013 21:37
-
-
Save simos/7535778 to your computer and use it in GitHub Desktop.
Sample that kills the parent process. If you run from within a terminal, the program will terminate the calling shell (thus terminating the terminal window).
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 <signal.h> /* For SIGKILL */ | |
int main() | |
{ | |
/* Sends the SIGKILL signal to the Parent Process ID (ppid) */ | |
kill(getppid(), SIGKILL); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment