Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
signal(3) OSS Library Calls Reference Manual
function is identified by the SIG_DFL value for signal action.) If the signal specified by the sig-
nal parameter is unknown, the value -1 is returned and errno is set to [EINVAL].
If signal( ) is called in a code module compiled in the OSS environment and called from a TNS or
accelerated Guardian process (main( ) was compiled with systype guardian), the value -1 is
returned and errno is set to [ENOTOSS].
Specifying the Signal
The signal parameter specifies the signal. All signal values are valid if the corresponding action
is to restore the default action. All signals can be caught or ignored except the SIGKILL, SIG-
STOP, and SIGABEND signals; these signals can neither be caught nor ignored.
Specifying the Function
The function parameter can have the SIG_DFL or SIG_IGN value, or it can point to a function.
SIG_DFL and SIG_IGN are defined in the signal.h header file. A SIG_DFL value requests
default action to be taken when the signal is delivered. A value of SIG_IGN requests that the
signal have no effect on the receiving process. A pointer to a function requests that the signal be
caught; that is, the signal causes the signal-handling function to be called. These actions are
described in detail in the signal(4) reference page.
The action is ignored when the function parameter is set to the SIG_DFL value for a signal that
cannot be caught or ignored.
Use From a Threaded Application
The thread-aware signal( ) function allows the calling thread to change the action to be taken
when a specific signal is delivered to the thread calling this function. The thread-aware behavior
of this function is always enabled in the POSIX User User Thread (PUT) Model library.
Because this function is always thread-aware in the PUT library, when the thread library signal
handler receives the signal, the thread library signal handler checks to see if the current thread
can handle the signal. If the thread can handle the signal, then the thread library signal handler
invokes the thread signal handler immediately. If the current thread cannot handle the signal, the
thread library signal handler finds a thread that can handle the signal, adds the signal to the queue
for that thread, and returns. The thread signal handlers for queued signals are run either at the
thread dispatch time or at the cancellation point.
NOTES
To use the signal( ) functionality in a threaded application that uses the Standard POSIX Threads
library, see spt_signal(2).
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:
6−60 Hewlett-Packard Company 527187-017