Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) sigaltstack(2)
SS_ONSTACK
The process is currently executing on the alternate signal stack. Attempts to
modify the alternate signal stack while the process is executing on it fail. This
flag cannot be modified by processes.
SS_DISABLE The alternate signal stack is currently disabled.
The value SIGSTKSZ is a system default that specifies the number of bytes that are usually
required when manually allocating an alternate stack area. The value MINSIGSTKSZ is defined
to be the minimum stack size for a signal handler. In computing an alternate stack size, an appli-
cation should add the value MINSIGSTKSZ to its stack requirements to allow for the system
implementation overhead. The constants SS_ONSTACK, SS_DISABLE, SIGSTKSZ, and
MINSIGSTKSZ are defined in the signal.h header file.
After a successful call to one of the exec set of functions, no alternate signal stacks exist in the
new process image. After a successful call to the fork() function, the alternate signal stack
exists in the child process at the same address and with the same contents.
A signal handler only runs on the alternate signal stack if the thread that defined the signal
handler is not blocked when the signal is delivered. If the thread is blocked, the signal handler
runs on the user stack.
The SA_ONSTACK flag (see spt_sigaction(2)) has no effect in the Guardian environment.
NOTES
To ensure proper operation of the fork( ) function, you must allocate alternate signal stacks as
protected user stacks by setting the ST_COF (copy stack to child process upon fork()) option of
the STACK_ALLOCATE_() procedure.
The sigaltstack() requires the specified stack address and size describe exactly a user stack seg-
ment as created by the STACK_ALLOCATE_() procedure. If the specified stack address and
size do not describe a valid user stack segment as created by the STACK_ALLOCATE_() pro-
cedure, sigaltstack() returns the value -1 and sets errno to [EFAULT].
You should not use this function in a threaded application that uses the Standard POSIX Threads
(SPT) library. Use of this function with the SPT library may result in undefined behavior.
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running H06.21 or later RVUs or J06.10 or later RVUs, you must perform all of the fol-
lowing tasks to make the function thread-aware in a multi-threaded application:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit threaded applications.
To use this function in a 32-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, perform the same tasks (described above) used to make the function
thread-aware in a multi-threaded application on systems running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, you must perform all of the following tasks to make the function thread-
aware in a multi-threaded application:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
527186-023 Hewlett-Packard Company 7−99