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

jack at boring.UUCP jack at boring.UUCP
Fri Mar 15 23:53:36 AEST 1985


In article <179 at encore.UUCP> ptw at encore.UUCP (P. Tucker Withington) writes:
>As I read the manual (I didn't read the code) pause will only return when a
>signal is "caught".  If the semantics were that it would also return
>(immediately) if there were no signal handlers active (since they revert when
>caught), the race condition would also disappear.  

This sounds nice at first, but gives rise to some even weirder
situations.
 For instance, I have a program that uses this feature, and then,
later on, decide to put an interrupt handler in it, in case the
user wishes to abort the program.
 Guess what? Suddenly my program stops working!! I wouldn't want
to look for *that* bug........
 An other approach would be to let pause() return if there is no
signal handler for SIGALRM, but I'm sure that there are people
who use pause() for things totally unrelated to alarm() calls.

 By the way, I *do* agree that it might not be a bad idea to
have pause() return when there are no signal handlers installed,
but I think it is not a complete solution to this race condition.
-- 
	Jack Jansen, {decvax|philabs|seismo}!mcvax!jack
It's wrong to wish on space hardware.



More information about the Comp.unix.wizards mailing list