Hi
I want to catch a signal and continue the program. But when I catch it, my signal handler takes the control and program terminates after the signal handler returns.
Here is the code
I want to print screen "Signal" continuously when a signal is caugth (so, print "Signal" once in a second).Code:struct itimerval it; static void sig_handler(int sig) { printf("Signal\n"); } int main() { signal(SIGALRM,sig_handler); it.it_value.tv_sec=1; it.it_value.tv_usec=0; setitimer(ITIMER_REAL,&it,0); sleep(10); return 0; }
How can I do this?
Thanks...



LinkBack URL
About LinkBacks



