Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_sigaction(2)
NAME
spt_sigaction - Specifies the action to take upon delivery of a signal (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int spt_sigaction(
int sig,
const sigaction_t *act,
sigaction_t *o_action);
PARAMETERS
sig Specifies the signal number.
act Points to a sigaction_t structure that describes the new action to be taken on
delivery the signal identified by the sig parameter.
o_action Points to a sigaction_t structure that returns the signal action previously associ-
ated with the signal.
DESCRIPTION
The spt_sigaction() function allows the calling thread to change or examine the action to be
taken on delivery of a specific signal. This call removes any previously established signal
handler for this signal for this thread. You must reestablish the previous signal handler if you
want to use it at a later time.
To catch externally generated signals (such as SIGINT, SIGQUIT, SIGALRM, and SIGCHLD) at
the thread level, you must export the SPT_THREAD_AWARE_SIGNAL environmental variable
to the value 1. By default, SPT_THREAD_AWARE_SIGNAL is disabled. If you export
SPT_THREAD_AWARE_SIGNAL to 1, the signal handler registered for that thread will be exe-
cuted immediately within the scope of the internal generic handler for pthreads. However, the
thread itself executes only when it is scheduled. Consequently, you cannot use thread-specific
functions like pthread_self( ) inside thread-specific signal handler functions.
You should not use the SA_ONSTACK flag and the SA_ONSTACK_COMPATIBILITY
feature test macro in a threaded application that uses the Standard POSIX Threads library. Use
of these two options can result in undefined behavior in the SPT environment.
Every signal has an associated default action. The spt_signal() function can change this action
by specifying that the receiving thread:
• Ignore the delivery of a specific signal.
• Restore the default action for a specific signal.
• Invoke a signal-catching function in response to the delivery of a specific signal.
For the defined signal names and details about the cause and default action of each defined sig-
nal, see the signal(4) reference page
NOTES
To use this function in a threaded application that uses the Standard POSIX Threads library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks:
527186-023 Hewlett-Packard Company 7−415