The man page for signal says
Unlike on BSD systems, signals under Linux are reset to
their default behavior when raised. However, if you
include <bsd/signal.h> instead of <signal.h> then signal is
redefined as __bsd_signal and signal has the BSD
semantics.
However I tried the following simple program and found that if I install
a signal handler once, it remains installed over multiple deliveries of
the same signal. i.e. the signal does not get reset to its default
behaviour when raised.
#include <stdio.h>
#include <signal.h>
void handler( int x) {
printf( "Got the signal\n");
main() {Quote:}
char c;
signal(28, handler);
sleep(3600);
printf( "Woke up\n");
sleep(3600);
and the I did 'kill -28 <pid>' twice. Both the times I got theQuote:}
message from signal handler.
Can anyone help explain this contradiction or am I messing up
somewhere in the concepts?
Thanks,
-Kartik