Sets and gets signal stack context.
Standard C Library (libc.a)
The sigstack subroutine defines an alternate stack on which signals are to be processed.
When a signal occurs and its handler is to run on the signal stack, the system checks to see if the process is already running on that stack. If so, it continues to do so even after the handler returns. If not, the signal handler runs on the signal stack, and the original stack is restored when the handler returns.
Use the sigvec or sigaction subroutine to specify whether a given signal-handler routine is to run on the signal stack.
Item | Description |
---|---|
InStack | Specifies the stack pointer of the new signal stack.
If the value of the InStack parameter is nonzero, it points to a sigstack structure, which has the following members:
The value of InStack->ss_sp specifies the stack pointer of the new signal stack. Since stacks grow from numerically greater addresses to lower ones, the stack pointer passed to the sigstack subroutine should point to the numerically high end of the stack area to be used. InStack->ss_onstack should be set to a value of 1 if the process is currently running on that stack; otherwise, it should be a value of 0. If the value of the InStack parameter is 0 (that is, a null pointer), the signal stack state is not set. |
OutStack | Points to structure where current signal stack state is stored.
If the value of the OutStack parameter is nonzero, it points to a sigstack structure into which the sigstack subroutine stores the current signal stack state. If the value of the OutStack parameter is 0, the previous signal stack state is not reported. |
Upon successful completion, the sigstack subroutine returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The sigstack subroutine is unsuccessful and the signal stack context remains unchanged if the following is true:
Item | Description |
---|---|
EFAULT | The InStack or OutStack parameter points outside of the address space of the process. |