Skip to content

Instantly share code, notes, and snippets.

@simos
Created November 18, 2013 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simos/7535778 to your computer and use it in GitHub Desktop.
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).
#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