Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both | POSIX(ON) |
#define _XOPEN_SOURCE_EXTENDED 1
#include <signal.h>
int sigstack(struct sigstack *ss, struct sigstack *oss);
The sigstack() function allows the calling thread to indicate, to the system, an area of its address space to be used for processing signals received by this thread.
If the oss argument is not a NULL pointer, it must point to a sigstack structure into which the current alternate signal stack context is placed. The value stored in the ss_onstack member of this sigstack structure will be nonzero if the thread is currently executing on the alternate signal stack. If the oss argument is a NULL pointer, the current alternate signal stack context is not returned.
When a signal's action indicates its handler should execute on the alternate signal stack (specified by calling sigaction()), the implementation checks to see if the thread is currently executing on the alternate signal stack. If it is not, the system will switch to the alternate signal stack for the duration of the signal handler's execution.
After a successful call to one of the exec functions, there are no alternate signal stacks in the new process image.
This function is kept for historical reasons. It was part of the Legacy Feature in Single UNIX Specification, Version 2, but has been withdrawn and is not supported as part of Single UNIX Specification, Version 3. New applications should use sigaltstack() instead of sigstack().
If it is necessary to continue using this function in an application written for Single UNIX Specification, Version 3, define the feature test macro _UNIX03_WITHDRAWN before including any standard system headers. The macro exposes all interfaces and symbols removed in Single UNIX Specification, Version 3.
If successful, sigstack() returns 0.