sigsetmask

Establishes those signals that are blocked from delivery.

Format

#include  <signal.h>

int sigsetmask  (int mask);

Argument

mask
The signals to be blocked.

Description

See the sigblock function in this section for information about the mask argument.

Return Value
The previous set of masked signals. 

sigstack (VAX only)

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.

Format

#include  <signal.h>

int sigstack  (struct sigstack *ss, struct sigstack
              *oss);

Arguments

ss
If ss is not NULL, it specifies the address of a structure that holds a pointer to a designated section of memory to be used as a signal stack on which to deliver signals.
oss
If oss is not NULL, it specifies the address of a structure in which the old value of the stack address is returned.

Description

The sigstack structure is defined in the standard header file <signal.h> as follows:
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.

Return Values
Indicates success. 
-1  Indicates failure. 

Example

    #define ss_size 15000
    static char mystack[ss_size];
    struct sigstack ss = {&mystack + sizeof(mystack) - sizeof(void *), 1};
    


Previous Page | Next Page | Table of Contents | Index