*BSD News Article 95187


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news-feed1.tiac.net!uunet!in3.uu.net!194.222.144.22!erlenstar.demon.co.uk!not-for-mail
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Newsgroups: comp.unix.bsd.freebsd.misc,comp.unix.programmer
Subject: Re: sigprocmask problems
Date: 12 May 1997 21:03:03 +0100
Organization: disorganised
Lines: 21
Message-ID: <87n2q0mpag.fsf@erlenstar.demon.co.uk>
References: <5l7ahf$dld@newstoo.ericsson.se>
NNTP-Posting-Host: localhost
Cc: martti.kuparinen@era.ericsson.se (Martti Kuparinen)
X-Mayan-Date: Long count = 12.19.4.2.16; tzolkin = 7 Cib; haab = 14 Uo
X-Attribution: AG
X-Newsreader: Gnus v5.3/Emacs 19.34
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:40770 comp.unix.programmer:54289

>>>>> "Martti" == Martti Kuparinen <martti.kuparinen@era.erixsson.se> writes:

 Martti> The following code fragment is giving me head ache. It works
 Martti> great in Linux and Solaris 2.5 but not in FreeBSD 2.2 :-(

 Martti> If you send SIGHUP when signals are enabled, the program
 Martti> prints SIGHUP as expected. But then after this "kill -HUP
 Martti> <pid>" thing the sleep(10) statements become almost like
 Martti> sleep(1)...

 Martti> Any ideas why?

longjmp out of a sleep() call is a bad move; on systems where sleep() is
implemented in user mode (true for FreeBSD, don't know about the others),
it will leave an alarm set for the original wakeup time, which affects
further uses of sleep().

-- 
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>