int sigaction(int sig, const struct sigaction *act, struct sigaction *old_act);
This system call implements the POSIX sigaction function, which changes the action to be performed when the specified signal is delivered to the program.
MOSS supports both traditional POSIX.1 signal handlers, as well as POSIX.1b handlers for real-time, queued signals, which take additional arguments. Queued signals are especially useful if you want to service multiple hardware interrupts with a single signal handler, because a value identifying the interrupt can be passed, and multiple generated signals will not be ``collapsed'' into one as in POSIX.1 and traditional Un*x.
Any processor exceptions the program generates will generate appropriate signals, e.g. SIGFPE for divide by zero, SIGTRAP for debuggin-related exceptions, SIGILL for invalid opcode, and SIGSEGV for protection violations and other serious exception conditions. The program can catch these signals with a signal handler if desired.
Of course, processor exceptions that occur in MOSS itself or in DOS do not produce application-visible signals; they merely cause the DOS extender to panic.
MOSS currently does not prevent the application from catching or ignoring SIGKILL or SIGSTOP signals as specified by POSIX. (``Security'' is pretty meaningless under DOS anyway.)
- The signal number whose action is to be changed.
- If non-NULL, must point to the new action to give the signal. act->sa_handler may be either SIG_DFL, SIG_IGN, or a pointer to a signal handler function. The SA_SIGINFO bit can be set in act->sa_flags to request that the additional parameters specified by POSIX.1b be supplied to the signal handler function.
- If non-NULL, the original action associated with the signal is stored in the provided structure before the signal action is changed.
Returns 0 if successful, or -1 on error, in which case errno indicates the error.