Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

sigaltstack(2) OSS System Calls Reference Manual
NAME
sigaltstack - Sets and gets the signal alternate stack context
LIBRARY
H-series and J-series OSS processes: implicit libraries
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#include <signal.h>
int sigaltstack(
const stack_t *ss,
stack_t *oss);
PARAMETERS
ss Specifies the signal alternate stack context that is to be defined as a result of the
current call to the sigaltstack() function. If ss is a null pointer, no action is
taken, but the current alternate signal stack state is returned in the stack_t struc-
ture pointed to by oss.
oss Points to a stack_t structure that returns the signal alternate stack context in
effect before the call was made. If the parameter is not a null pointer, the alter-
nate signal stack context in effect at the time of the sigaltstack() call is returned.
DESCRIPTION
The sigaltstack() function allows a process to define or examine the state of an alternate stack
for signal handlers for the calling thread. Signals that have been explicitly declared to execute
on the alternate stack are delivered on the alternate stack.
When the sigaltstack() function is used in a threaded application that uses the POSIX User
Thread Model library, this function only allows the user thread to examine the state of an alter-
nate stack for signal handlers; it does not allow the user thread to define a new alternate stack. If
sigaltstack( ) is called to install a new alternate stack with this library, sigaltstack() returns the
value -1 and sets errno to [EINVAL].
Use From the Guardian Environment
If called from a TNS or accelerated Guardian process, the actions of this function are undefined
and errno is set to [ENOTOSS].
The sigaltstack() function can be called from H-series or J-Series native Guardian processes on
systems running J06.10 or later RVUs or H06.21 or later RVUs.
Specifying Options
If ss is not a null pointer, it points to a stack_t structure that specifies the alternate signal stack
that takes effect upon return from sigaltstack(). The ss_flags field specifies the new stack state. If
it is set to SS_DISABLE, the stack is disabled and ss_sp and ss_size are ignored. Otherwise, the
stack is enabled, and the ss_sp and ss_size fields specify the new address and size of the stack.
The sigaltstack() function only accepts a stack pointer obtained from the
STACK_ALLOCATE_() procedure.
If oss is not a null pointer, on successful completion, it points to a stack_t structure that specifies
the alternate signal stack that was in effect prior to the call to the sigaltstack() function. The
ss_sp and ss_size fields specify the address and size of that stack. The ss_flags field specifies the
stacks state as one of the following values:
798 Hewlett-Packard Company 527186-023