sig_atomic_t sigusr1_count=0;void handler(int signal_number){ ++sigusr1_count;}int main(){ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler=&handler; sigaction(SIGSEGV, &sa, NULL); ....}