I have just some questions about the system calls signal, kill and the signal handler. I have this code: 1) I don’t understand why the first printf in the first child, return -1 without a sleep(1) before…seems that the handler is executed after the beginning of the child. 2) When there is a kill to a child, after this, the
Tag: handler
how to alternate continously Signal handler
I want to write a program in c for linux that catchs the first SIGUSR1 signal, ignores the second one and continue in this behaviour (catch-ignore) for the successive SIGUSR1 signals. I wonder how to keep alternating between the two handlers, because once i set the handler to SIG_IGN, the signal will be ignored and I won’t be able to
timer_create() not able to catch a signal in handler function
Here i am trying achieve a timer say 0-10secs and an interval of 2secs each,so that i need to generate an interrupt @ every 2secs(total 5 times) saying 2secs completed. which i have been cross checking in handler() function by using printf(). But i am not able to achieve the desired result.please put me touch if anyone is aware of
“Alarm clock” message on linux
I’m working on a project written in C and I’m using alarms. In the beginning of the code I use sigaction() to initialize the alarm: Then I call the alarm with the alarm() function in a loop: The program sends the first alarm and runs the handler function, but when he sends the second one a message appears on the