strange definitions of SA_* flags

Ben Wing (wing@netcom.com)
Mon, 14 Aug 1995 03:53:34 GMT


In the process of trying to write signal code that works over a
variety of systems, I've discovered some things in the sigaction()
flags in Linux that are incompatible with other systems.

Here's what the man page says:

SA_ONESHOT
Restore the signal action to the default
state once the signal handler has been
called. This is the default behavior.

Linux 1.0 24 September 1994 1

SIGACTION(2) Linux Programmer's Manual SIGACTION(2)

SA_RESTART
The opposite to SA_ONESHOT, do not restore
the signal action. This provides behavior
compatible with BSD signal semantics.

SA_NOMASK
Do not prevent the signal from being
received from within its own signal handler.

[This definition of SA_RESTART is not only incompatible with every
other system, but is not even how Linux does things -- the actual
behavior is correct w.r.t. other systems and the man page is
wrong. Is this fixed in more recent man pages?]

I have never seen SA_ONESHOT or SA_NOMASK on any other systems.
Where did these come from? Both SunOS and SVR4 have a SA_RESETHAND
that is equivalent to SA_ONESHOT, and SVR4 has a SA_NODEFER
that is equivalent to SA_NOMASK.

ben