This class should not be instantiated. All messages are sent directly to the class. In what follows, "signum" is either a numeric signal number (e.g. 11) or its mnemonic equivalent (e.g. "SIGSEGV").
default: signum Specify that the default action for "signum" is to be reinstalled.
install: (signum,action) Specify that "action" is to be sent a "do!" message whenever "signum" is caught.
raise: signum Send "signum" to self.
set_immediate: signum Specify that the signal handling action is to be invoked immediately upon receipt of a signal, rather than deferred until the next message send. This should be used for any signal caused by an instruction stream exception, such as SIGBUS or SIGSEGV. Otherwise, returning from the internal signal handler without invoking the associated action object will result in an infinite loop of signal generation, without the action object ever getting a chance to be invoked.
set_deferred: signum Specify that the signal handling action is deferred until the next message send. This is the default behavior and is used to protect against reentry into certain routines like the message passing
mechanism, the parser, the X toolkit intrinsics, etc.
signal_handler install:("SIGSEGV",segv_handler) set_deferred:"SIGSEGV";
actions new:segv_handler tick_actions= `signal_handler raise:SIGINTR;';
On System V based machines, a signal is restored to its default action after invocation of the signal handler. The signal_handler class, however, ensures that handlers get re-installed whenever they are invoked.
There are other machine-dependent aspects of signals to beware of. Some signals cannot be caught and/or ignored. Some machines block certain signals under certain circumstances. See signal(2) (System V) or signal(3) (BSD) in the Unix Reference Manual for complete system-specific details.