#include #include #include void print_hi(int x){ printf("Received signal %d\n", x); } int main(){ struct sigaction action; action.sa_handler = print_hi; sigaction(SIGINT, &action, 0); sigaction(SIGQUIT, &action, 0); sigaction(SIGTERM, &action, 0); /* This was just a weird example int(*x)(void) = main; void (*y)(int) = print_hi; y(5); */ while(1){ sleep(1); puts("beep"); } return 0; }