I have implemented a POSIX timer using timer_create( ) API, and this will generate SIGUSR1 when the timer expires for which i have put a handler code. Now the problem is, if this program receives another SIGUSR1, then the same signal handler will be invoked and caught.
Is there any way to prevent this, so that the handler can catch signals only generated by the timer?
Will this work for you? (Modified the code from example in
timer_createman page.)When signal from timer is caught
Caught signal 10 from timerwill be displayed. OtherwiseStray signalwill be displayed.