Using the REXX signal services
The REXX signal services consist of the following syscall commands:
- alarm
- kill
- pause
- sigaction
- sigpending
- sigprocmask
- sigsuspend
- sleep
- To use the REXX signal catcher as the action for a signal, you
can specify the SIG_CAT variable as the signal handler on sigaction.
SIG_CAT can terminate various wait conditions without causing the process to end. If a signal arrives when the process is not currently waiting and the signal is not blocked, it might be lost.
There are two primary uses for SIG_CAT: when you are using the alarm command, and when you want to avoid unexpected process termination for other unblocked signals.
SIG_CAT causes a signal to interrupt conditions such as waits and blocks, but the application cannot determine which signal was delivered. It is not a traditional signal catcher, as implemented in the C language.
- To set the action to the default action, you can specify SIG_DFL as the signal handler on sigaction.
- To set the action to ignore the signal, you can specify SIG_IGN as the signal handler on sigaction.
POSIX.1 defines several C functions to manipulate signal sets. REXX does not define these functions; however, you can define each function using a single REXX statement, as shown in Table 1.
| C function | Equivalent REXX statement |
|---|---|
| sigsetempty() | sigsetempty: return copies(0,64)
|
| sigfillset() | sigfillset: return copies(1,64)
|
| sigaddset() | sigaddset: return overlay(1,arg(1),arg(2))
|
| sigdelset() | sigdelset: return overlay(0,arg(1),arg(2))
|
| sigismember() | sigismember: return substr(arg(1),arg(2),1)
|