Re: Resetting signal handlers

Jeff Coy Jr. (jcoy@flash.net)
Sun, 15 Jun 1997 10:11:39 -0700 (MST)


On Sun, 15 Jun 1997, Shay Rojansky wrote:

> Hi.
>
> While programming something using signals, I happened to notice
> that Linux resets signal handlers after a signal is caught (i.e.
> you have to call the signal function again from within the handler).
> Looking at the signal(2) man page, I found that including bsd/signal.h
> instead of signal.h fixes this behaviour. How about standardizing
> this to POSIX.1 by having Linux stop resetting handlers? The race
> condition that could happen if the signal is generated before
> the signal function is called again. And besides, doing so won't break
> existing Linux programs (since the signal function would simply be
> called twice).
>
> So, what about it?
>

POSIX says not to use signal(), use sigaction().

jeff

--
"UNIX is simple and coherent, but it takes a genius (or at any rate,
 a programmer) to understand and appreciate its simplicity"

-Dennis Ritchie [USENIX '87]