The Interix Software Development Kit (SDK) supports only one set of
signal semantics: the POSIX.1 set. It supports several different
sets of signal-handling application programming interfaces (APIs),
however. These are as follows:
American National Standards Institute (ANSI) C signals are
supported with the function signal(). Because this API is
built on top of the POSIX.1 sigaction() model, it might
behave unexpectedly.
POSIX.1 signals are supported with the functions
sigaction(), sigpending(), sigprocmask(),
sigsuspend(), sigemptyset(), sigfillset(),
sigaddset(), sigdelset(), and
sigismember().
Berkeley Software Distribution (BSD) 4.3 signals are supported
with the functions killpg(), sigsetmask(),
sigblock(), and sigvec(). The signal mask for these
functions is an int, not a sigset_t. If a future
release of the Interix SDK supports more than 32 signals, these
functions will become obsolete. Rather than depend on them, convert
your code to use the POSIX.1 signal calls. Although
sigpause() is provided, it is provided as the System V call,
which does not behave in the same way as the BSD call.
System V signals are supported with the functions
sighold(), sigignore(), sigpause(),
sigrelse(), and sigset().
The following important information applies when you are using
signals with the Interix SDK:
Signals on a POSIX.1 system are neither BSD nor System V
Interface Definition (SVID). POSIX defined a new signal mechanism
based on the API sigaction().
The set of signals available is the set described in POSIX.1
and the Single UNIX Specification. Your code should use the
symbolic names instead of the actual values, since some numbers
might differ from traditional implementations.
The POSIX.1 committee introduced their new signal semantics
because of problems with traditional signal implementations found
on BSD and System V systems. When the System V3 signal()
catches a signal, the action associated with the signal is reset to
the default. In 4.3 BSD, it is not reset. In the International
Standards Organization/American Standards Institute (ISO/ANSI) C
standard, the signal() function either resets the default or
does an implementation-defined blocking of the signal. The POSIX
sigaction() call does not reset the default if the handler
returns normally. The Interix SDK follows the POSIX signal
semantics.
Because an Interix SDK process has a signal mask, it can block
certain signals from arriving, except for SIGKILL or SIGQUIT. A
process starts with a signal mask inherited from its parent. If any
signals are generated and then blocked by the signal mask, they go
into the set of pending signals.
If you are using the signal() API, the signal is still
masked and remains masked until the mask is cleared. This can be a
significant problem if your code does a longjmp() from the
handler. Using sigaction() directly and siglongjmp()
will correct some of those unexpected behaviors.