#include #include #include #include #include typedef struct sigaction SIGS; int counter = 0; void handler(int sig, siginfo_t* info, void* context) { if (sig == SIGUSR1){ counter++; printf("Hello!\n"); }else if ( sig == SIGUSR2 ){ printf("%d\n", counter); abort(); } } int main(int argc, char *argv[]){ SIGS context = {.sa_flags = SA_SIGINFO, .sa_sigaction = handler}; while(1) pause(); return 0; }