🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #1346

fork() and alarm()

#1346
From: Andrew Ernest
Date: Fri, 02 Feb 1990 03:43
21 lines
1421 bytes
From: andrew@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@ramona.Cary.NC.US>

Volume-Number: Volume 18, Number 36
Technical Details
Message-ID: <523@longway.TIC.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!longway!std-unix

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!longway!std-unix
From: andrew@ramona.Cary.NC.US (Andrew Ernest)
Newsgroups: comp.std.unix
Subject: fork() and alarm()
Message-ID: <523@longway.TIC.COM>
Date: 2 Feb 90 03:43:00 GMT
Sender: std-unix@longway.TIC.COM
Reply-To: andrew@ramona.Cary.NC.US (Andrew Ernest)
Lines: 21
Approved: jsq@longway.tic.com (Moderator, John S. Quarterman)