Missing a signal and pausing forever

guy at rlgvax.UUCP guy at rlgvax.UUCP
Sat Jul 9 09:51:27 AEST 1983


4.?BSD does have such a facility for "raising the interrupt priority" of a
process and lowering it later, with the new signal mechanism.  Saying

	sigsys(sig, SIG_HOLD);

causes the signal to be remembered if it occurs, but not be presented to
the process; if the process changes the action for the signal, it is presented
to the process (or discarded if the action is changed to SIG_IGN).  Furthermore,
you set the "interrupt new PSW" for the signal to set the signal to SIG_HOLD
rather than SIG_DFL by saying

	sigsys(sig, DEFERSIG(routine));

which means that the signal action is reset to SIG_HOLD when "routine" is
entered.  There are also facilities for dismissing signals more cleanly.

The UNIX signal mechanism does need work to make it useful for general
inter-process communication; UNIX also needs block-wakeup and message
mechanisms, both of which are in USG UNIX 5.0 (semaphores, message queues)
and the latter of which is in 4.1c/4.2BSD - the former can be simulated under
4.1c/4.2 with exclusive-use opens on a file.  4.1c/4.2 also has a more
elaborate signal mechanism.

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list