When does ( alarm(1) == alarm(INFINITY) ) ?

P. Tucker Withington ptw at encore.UUCP
Wed Mar 13 04:52:28 AEST 1985


It seems to me that the ill-defined functionality of alarm, signal, and pause
is just a plain, old, *bug* that should be addressed by AT&T and/or the Unix
standards committee rather than hack-fixed.  (Maybe they already did?)

My proposal (2 cent royalty):

The *kernel* should maintain a per-process "wakeup waiting" flag that is
cleared by signal, set when a signal is caught in user mode, and causes pause
to return immediately (as if interrupted) if it is set when a pause is invoked.
I believe this would both eliminate the race/vulnerable condition and stay
within the original intent of the semantics of signals and pause.  (To the
extent that read, write, and wait have similar semantics w.r.t. signals, they
should also use the flag.)

                               o.o      --tucker
                                ~



More information about the Comp.unix.wizards mailing list