In said:
The definition of signals in the C standard places no requirements at
all on the operating system. C defines what happens if signal
handlers are installed and the corresponding identifier is used in a
call to raise(). If a signal handler is invoked any other way, the C
standard does not define the results.
Bullshit! The C standard specifies what an asynchronously invoked
signal handler is allowed to do without invoking undefined behaviour.
5 If the signal occurs other than as the result of calling the
abort or raise function, the behavior is undefined if the signal
handler refers to any object with static storage duration other
than by assigning a value to an object declared as volatile
sig_atomic_t, or the signal handler calls any function in
the standard library other than the abort function, the _Exit
function, or the signal function with the first argument equal
to the signal number corresponding to the signal that caused
the invocation of the handler. Furthermore, if such a call to
the signal function results in a SIG_ERR return, the value of
errno is indeterminate.
It's only the asynchronous delivery of *certain* signals (SIGFPE, SIGILL,
SIGSEGV) that renders the program's behaviour undefined if the signal
handler ever returns.
What the standard does not guarantee is that a signal handler will be
ever invoked asynchronously.
Dan