Open System Services System Calls Reference Manual (G06.25+, H06.03+)

sigaction(2) OSS System Calls Reference Manual
The SIGKILL, SIGSTOP, and SIGABEND signals cannot be blocked. If a program attempts to
block any of these signals, the system removes them from the signal mask without generating an
error. For example, if a call to sigaction() tries to block the SIGKILL signal and then a subse-
quent call returns the signal-handling information in the structure pointed to by the
o_action
parameter, the returned mask is not the same mask that the original call passed in; the difference
is that the returned mask does not include the SIGKILL signal.
Specifying Options
Unless you are using standard POSIX threads, the sa_ags eld can have the SA_NOCLDSTOP
bit set to specify further control over the actions taken on delivery of a signal. If the signal
parameter is SIGCHLD and a child process of the calling process stops, a SIGCHLD signal is
sent to the calling process unless SA_NOCLDSTOP is set for SIGCHLD.
Use With Standard POSIX Threads
When using standard POSIX threads, specify the spthread.h header le. The signal.h header le
can be omitted.
A multi-threaded process can use the sigaction() function to establish thread-specic actions for
synchronous signals. Each thread can have its own signal handler routine.
When you use the standard POSIX threads version of sigaction():
The sigaction() function only modies behavior for individual threads.
The sigaction() function only works for synchronous signals. Attempting to set a signal
action for an asynchronous signal is an error. This is true even in a single-threaded pro-
cess.
The signal mask is manipulated using the following functions: sigemptyset(),
sigllset(), sigaddset(), sigdelset(), and sigismember().
RETURN VALUES
Upon successful completion of the sigaction() function, the value 0 (zero) is returned. Other-
wise, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the sigaction() function sets errno to the correspond-
ing value and no new signal-catching function is installed:
[EFAULT] The action or o_action parameter points to a location outside of the allocated
address space of the process.
[EINVAL] One of the following conditions exists:
The signal parameter is not a valid signal number.
An attempt was made to ignore or supply a signal-catching function for
the SIGKILL, SIGSTOP,orSIGABEND signal.
[ENOTOSS] The calling process was not an OSS process or a native Guardian process. The
requested operation cannot be performed from the Guardian environment by a
TNS or accelerated Guardian process.
RELATED INFORMATION
Commands: kill(1).
Functions: _exit(2), exit(3), kill(2), pause(3), pthread_sigmask(2), setjmp(3), sigaddset(3),
sigdelset(3), sigemptyset(3), sigllset(3), sigismember(3), signal(3), sigprocmask(2), sig-
suspend(2), umask(2), wait(2).
762 Hewlett-Packard Company 527186-003