Establishes those signals that are blocked from delivery.
#include <signal.h> int sigsetmask (int mask);
x | The previous set of masked signals. |
Defines an alternate stack on which to process signals. This allows the processing of signals in a separate environment from that of the current process. This function is nonreentrant.
#include <signal.h> int sigstack (struct sigstack *ss, struct sigstack *oss);
struct sigstack { char *ss_sp; int ss_onstack; };
If the sigvec function specifies that the signal handler is to execute on the signal stack, the system checks to see if the process is currently executing on that stack. If the process is not executing on the signal stack, the system arranges a switch to the signal stack for the duration of the signal handler's execution. If the oss argument is not NULL, the current state of the signal stack is returned.
Signal stacks must be allocated an adequate amount of storage; they do not expand like the run-time stack. For example, if your signal handler calls printf or any similarly complex DEC C RTL routine, at least 12,000 bytes of storage should be allocated for the signal stack. If the stack overflows, an error occurs.
ss_sp must point to at least four bytes before the end of the allocated memory area (see the example). This is architecture- dependent and possibly not portable to other machine architectures or operating systems.
The sigstack structure is defined in the <signal.h> header file.
0 | Indicates success. |
-1 | Indicates failure. |
#define ss_size 15000 static char mystack[ss_size]; struct sigstack ss = {&mystack + sizeof(mystack) - sizeof(void *), 1};