User signals can be
synchronous or asynchronous; you can define
as many as eight of each type. Synchronous signals generally must be handled
immediately, while asynchronous signals either do not need to be handled immediately
or cannot be handled immediately for technical reasons.
Synchronous signals must be assigned one of the signal
numbers defined by the symbols SIGUSR1 through SIGUSR8. Asynchronous signals
must be assigned one of the signal numbers defined by the symbols SIGASY1
through SIGASY8. When you write the routine to define the signal, you can
rename it to have a more useful and mnemonic name.
There are no special requirements for defining asynchronous
signals. Additional considerations may apply, however, when defining asynchronous
signals for programs that use
pause
,
sigpause
,
sigsuspend
, or
sleep
; refer to the description of the ECBPP
field of ZENQARGS in Routine for Asynchronous Signals: L$CZENQ.
The following list describes the requirements for defining
a signal as synchronous.
-
The address of the CRAB must be in register 12,
and the value in register 13 must be addressable at the time of the interrupt.
If the optimized or minimal form of function linkage is in use, this register
13 value must address a C dynamic save area (DSA). Refer to Chapter 9, "Run-Time
Argument Processing," in SAS/C Compiler and Library User's Guide
for more information on the
=optimize
and
=minimal
options.
-
The signal must not be able to occur while the
SAS/C Library prolog or epilog is running.
-
The SAS/C Library must be able to operate normally
when the signal is generated. In particular, it must be possible to issue
SVC instructions.
-
Because of the possibility that the user may issue
a call to
longjmp
, the
program must be able to resume execution at some point other than the point
of interrupt. (It is possible, though not recommended, to use the executive
routine, described later in this chapter, to prevent using
longjmp
successfully by the handler.)
Copyright © 2001
by SAS Institute Inc., Cary, NC, USA. All rights reserved.