fork() and alarm()
Andrew Ernest
andrew at ramona.Cary.NC.US
Fri Feb 2 14:43:00 AEST 1990
From: andrew at ramona.Cary.NC.US (Andrew Ernest)
There's a UNIX system in existence that has (or at least had) a bug
(IMHO) where fork() does not do the equivalent of alarm(0) for the
child process. The AT&T docs seem quite clear on the point that
children don't inherit the parent's alarm() value: "The time left
until an alarm clock signal is reset to 0." But what about 1003.1?
On page 49 it says "Pending alarms are cleared for the child
process." What exactly does "pending" mean in this sentence? Pending
alarm signals (from alarms that have "gone off") that haven't already
been delivered? Why is alarm plural otherwise?
So, is it acceptable for a POSIX-conforming system to leave the set
alarm time alone so both the parent and child get the signal when the
alarm goes off? This makes forking safely so messy that I seriously
doubt it. It breaks many existing interactive programs.
--
Andrew Ernest <andrew at ramona.Cary.NC.US>
Volume-Number: Volume 18, Number 36
More information about the Comp.std.unix
mailing list