SSIGNAL(3,L) AIX Technical Reference SSIGNAL(3,L)
-------------------------------------------------------------------------------
ssignal, gsignal
PURPOSE
Implements a software signal facility.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <signal.h>
void (*ssignal (sig, action)) ( ) void gsignal (sig)
int sig; int sig;
void (*action) ( );
DESCRIPTION
The ssignal and gsignal subroutines implement a software facility similar to
that of the signal and kill system calls. However, there is no connection
between the two facilities. User programs can use ssignal and gsignal to
handle exceptional processing within an application. signal and related system
calls handle system-defined exceptions.
The software signals available are associated with integers in the range 1
through 16. Other values are reserved for use by the C library and should not
be used.
The ssignal subroutine associates the procedure specified by the action
parameter with the software signal specified by the sig parameter. The gsignal
subroutine "raises" the signal sig, causing the procedure specified by the
action parameter to be taken.
The action parameter is either a pointer to a user-defined subroutine, or one
of the constants SIG_DFL (default action) and SIG_IGN (ignore signal). The
ssignal subroutine returns the procedure that was previously established for
that signal. If no procedure was established before, or if the signal number
is illegal, then ssignal returns the value SIG_DFL.
The gsignal subroutine "raises" the signal specified by the sig parameter by
doing the following:
Processed November 7, 1990 SSIGNAL(3,L) 1
SSIGNAL(3,L) AIX Technical Reference SSIGNAL(3,L)
o If the procedure for sig is SIG_DFL, then the gsignal subroutine returns a
value of 0 and takes no other action.
o If the procedure for sig is SIG_IGN, then the gsignal subroutine returns a
value of 1 and takes no other action.
o If the procedure for sig is a subroutine, then the action value is reset to
SIG_DFL and the subroutine is called with sig passed as its parameter. The
gsignal subroutine returns the value that is returned by the
signal-handling subroutine.
o If the procedure for sig is an illegal value or if no procedure was ever
specified for that signal, then gsignal returns a value of 0 and takes no
other action.
RELATED INFORMATION
In this book: "kill, kill3, killpg" and "sigaction, sigvec, signal."
Processed November 7, 1990 SSIGNAL(3,L) 2