Using the REXX signal services

The REXX signal services consist of the following syscall commands:

  • alarm
  • kill
  • pause
  • sigaction
  • sigpending
  • sigprocmask
  • sigsuspend
  • sleep
REXX does not include a service that allows you to attach your own signal catcher. Instead, you have the following options:
  • 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.

Table 1. REXX statements for defining signal sets
C function Equivalent REXX statement
sigsetempty() sigsetempty: return copies(0,64)
  • Parameters: none
  • Returns: signal set
sigfillset() sigfillset: return copies(1,64)
  • Parameters: none
  • Returns: signal set
sigaddset() sigaddset: return overlay(1,arg(1),arg(2))
  • Parameters: signal set, signal number
  • Returns: signal set
sigdelset() sigdelset: return overlay(0,arg(1),arg(2))
  • Parameters: signal set, signal number
  • Returns: signal set
sigismember() sigismember: return substr(arg(1),arg(2),1)
  • Parameters: signal set, signal number
  • Returns: 0 (not member) or 1 (is member)