Guardian Procedure Calls Reference Manual
Considerations
• This procedure is the functional equivalent of the TNS ARMTRAP procedure for native processes.
• POSIX.1 compliance
This procedure is an extension to the POSIX.1 standard. The same effect can be achieved
while maintaining compliance with the POSIX.1 standard by calling the SIGPROCMASK_
procedure and a loop of SIGACTION_ procedure calls.
• Calling considerations
The SIGACTION_INIT_ procedure is designed to be called once, typically from the main
procedure of a program. Although it is not an error to call this procedure twice, native Guardian
C programmers should be aware that the Common Runtime Environment (CRE) library makes
this call before invoking the program's main function. Calling SIGACTION_INIT_ in a native
Guardian C program overrides the handler installed by CRE and can often simplify diagnosis
of faults or traps generated in the process.
SIGACTION_INIT_ sets the signal mask to unblock all signals. Pending signals are discarded.
The specified handler (or action) is installed for all signals whose default action is not SIG_IGN
and for which it is valid to specify the associated action. (You cannot specify an action for
the OSS SIGKILL, SIGABEND, or SIGSTOP signal.) The action for any signal that is ignored
by default is set to SIG_IGN. If the action specified is not applicable to a specific signal, then
the existing action for that signal remains unchanged.
If SIGACTION_INIT_ returns an error, the signal-handling state is not changed.
• Deferrable and nondeferrable signals
Deferrable signals that occur while the process is executing privileged code are deferred until
the process exits privileged execution mode. If these signals are not blocked, they are then
delivered to the handler, which is activated at the tip of the main stack.
Nondeferrable signals are immediately delivered to the specified handler. The handler executes
on the main stack or privileged stack of the calling process depending on whether the signal
occurs in nonprivileged code or privileged code and on whether the signal handler for that
signal is installed by a nonprivileged caller or privileged caller of SIGACTION_INIT_ as
follows:
Then the specified handler is activated at...And the signal handler for that signal
was installed by...
If a nondeferrable
signal occurs in...
the tip of the main stack (when the signal was
generated)
a nonprivileged or privileged caller
of SIGACTION_INIT_
nonprivileged code
the tip of the main stack (when the process
entered privileged mode)
a nonprivileged caller of
SIGACTION_INIT_
privileged code
the tip of the privileged stacka privileged caller of
SIGACTION_INIT_
privileged code
• Signal mask and nondeferrable signals
Before a signal handler is entered, a new signal mask is installed. This mask is formed from
the union of the current signal mask and the signal being delivered. If a nondeferrable signal
occurs and is blocked, the process abnormally terminates.
NOTE: Abnormally terminating a process when a nondeferrable signal is blocked is an extension
to the POSIX.1 standard. According to the POSIX.1 standard, a blocked nondeferrable signal has
an undefined outcome.
SIGACTION_INIT_ Procedure 1363