Skip to content

Instantly share code, notes, and snippets.

@jprudent
Last active February 9, 2016 12:56
Show Gist options
  • Save jprudent/034d4544ff608de187d4 to your computer and use it in GitHub Desktop.
Save jprudent/034d4544ff608de187d4 to your computer and use it in GitHub Desktop.
signal.c
#include <stdio.h>
#include <signal.h>
void infinite_loop(int signum) {
printf("in loop");
//signal(5, infinite_loop);
__asm__("int3");
}
int main(int argc, char ** argv) {
signal(5, infinite_loop);
printf("infinite loop\n");
__asm__("int3");
printf("Bye\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment