[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [LTP] fatal signal handling
>>>>> "aaron" == Aaron Laffin <firstname.lastname@example.org> writes:
aaron> Unlike on BSD systems, signals under Linux are reset to
aaron> their default behavior when raised. However, if you
aaron> include <bsd/signal.h> instead of <signal.h> then signal
aaron> is redefined as __bsd_signal and signal has the BSD seman<AD>
aaron> tics. Both versions of signal are library routines built
aaron> on top of sigaction(2).
My debian system has this on the signal manpage, and it appears to
describe exactly what are you seing.
Upon arrival of a signal with number signum the following
happens. If the corresponding handler is set to SIG_IGN,
then the signal is ignored. If the handler is set to
SIG_DFL, then the default action associated to the signal
(see signal(7)) occurs. Finally, if the handler is set to
a function sighandler then the signal is blocked and
sighandler is called with argument signum. The signal
remains blocked during the execution of the signal
aaron> However, when I ran the following snippit, my rh6.2 system went into the
aaron> infinite recursion:
With your program I get also the recursive behaviour, but It matches
very well the manpage semantics.
Hope this helps.
PD.: I will also preffer to use sigaction and the test to behave the
same in all the systems.
In theory, practice and theory are the same, but in practice they
are different -- Larry McVoy