![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
| Signal-Handling Functions | 
The 
oesigsetup
 function
enables you to control which
signals are managed by USS and which use support internal to the SAS/C library.
 
oesigsetup
 must be called before any other
signal-related function.
If there is no call to 
oesigsetup
 in a program called with 
exec
 linkage, the library assumes that all signals should be managed by
USS, if possible.  If there is no call to 
oesigsetup
 in a program not called with 
exec
linkage (a regular batch or TSO execution), the library assumes that no signals
should be managed by USS.
Note:   
This means that you must call 
oesigsetup
 in a program
without 
exec
 linkage if you need to use
USS signals.  ![[cautionend]](../common/images/cautend.gif)
The arguments to 
oesigsetup
 are two signal sets. The first defines the set of signals to be managed
by USS, and the second defines the signals to be managed by SAS/C. 
oesigsetup
 fails if any signal is included in both sets; unspecified
signals are handled as if 
oesigsetup
 had
not been called.
| Error Signals with Flexible Handling | 
The
signals with flexible handling can be divided into two groups:
error signals and other signals.  The error signals, normally associated with
program error condition, are 
SIGABND
, 
SIGABRT
, 
SIGFPE,
 
SIGILL
, and 
SIGSEGV
.  If these signals are handled as SAS/C conditions, USS is
not informed of the error when the corresponding error condition occurs. If
the error leads to termination, USS sets the final status of the terminated
process to terminated by 
SIGKILL
  rather than a more specific status; otherwise, you can expect no
undesirable effects.
Note:   
Starting with Release 6.00
of SAS/C software, the 
SIGABND
 signal is
used to indicate a system ABEND. As described in the next section, this is
a behavior change from previous versions of SAS/C.  ![[cautionend]](../common/images/cautend.gif)
| Non-Error Signals with Flexible Handling | 
The
non-error signals with flexible handling
are 
SIGALRM
, 
SIGINT
, 
SIGIO
, 
SIGTERM
, 
SIGUSR1
, and 
SIGUSR2
. If USS handles 
SIGALRM
,
the SAS/C extension functions 
alarmd
 and 
sleepd
 are not available.  If the SAS/C library
handles 
SIGALRM
, the 
ps
 shell command does not accurately indicate when the process is sleeping.
If SAS/C handles 
SIGINT
, 
SIGINT
 is generated by use of
the TSO attention key for a program running under TSO. If USS handles 
SIGINT
, SAS/C does not use the 
STAX
 macro or attempt to handle TSO attentions.  Be aware that SAS/C
handling of 
SIGINT
 is not useful in non-TSO
address spaces.
SIGIO
 has no special
meaning at present to either USS or SAS/C but might be used by future versions
of either product.
SIGTERM
 has no defined
meaning to SAS/C and, therefore, can be generated only by use of the 
raise
 function if managed by SAS/C.
SIGUSR1
 and 
SIGUSR2
 have no special meaning to USS. If 
oesigsetup
 defines these signals as
managed by
SAS/C, then you can use SAS/C user-added signal support to define a meaning
for one of these symbols.
Note:   
If you have defined a
signal as handled by SAS/C and the signal is generated by USS, the result
is always the USS default action for the signal.  For example, if you define 
SIGTERM
 as a SAS/C signal and establish a handler,
after which another process uses the 
kill
function to send your process a 
SIGTERM
signal, your handler will not be called and the process will be terminated.  ![[cautionend]](../common/images/cautend.gif)
A program can use 
kill
to send a signal that 
oesigsetup
 has defined
as a signal managed by SAS/C.  If a program sends the signal to itself, only
default handling will take place.
![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
![]() Top of Page  | 
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.