Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active October 15, 2018 20:03
Show Gist options
  • Save tonejito/e66bf96c9b802687481a0a88d9e2ccf0 to your computer and use it in GitHub Desktop.
Save tonejito/e66bf96c9b802687481a0a88d9e2ccf0 to your computer and use it in GitHub Desktop.
La mejor señal es SIGTERM, la mejor señal es SIGKILL.
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
void tangananica(int sig) {asm("nop;");}
void tanganana(int sig) {__asm__ ("nop;");}
int main(void)
{
printf("%s\n","La mejor señal es SIGTERM,");
signal(SIGTERM,tangananica);
printf("%s\n","la mejor señal es SIGKILL.");
signal(SIGKILL,tanganana);
printf("%s\n","");
printf("%s\n","Yo ya no aguanto el SIGTERM,");
kill(getpid(),SIGTERM);
printf("%s\n","ni yo tampoco el SIGKILL");
kill(getpid(),SIGKILL);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment