In the following code, would static be used just to keep the function sig_usr() file scoped? Or this there more to using static in this example.
Code:#include <signal.h> #include <stdio.h> #include <unistd.h> static void sig_usr(int signo) { if(signo == SIGUSR1) printf("received SIGUSR1\n"); } int main(void) { if (signal(SIGUSR1,sig_usr) == SIG_ERR) fprintf(stderr,"can't catch signal"); for(;;) pause(); }