home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!mcsun!Germany.EU.net!Urmel.Informatik.RWTH-Aachen.DE!physik.tu-muenchen.de!berg
- From: berg@physik.tu-muenchen.de (Stephen R. van den Berg)
- Subject: Re: SIGALRM handlers and sleep
- Message-ID: <1992Sep15.135222.2911@Urmel.Informatik.RWTH-Aachen.DE>
- Originator: berg@tabaqui
- Sender: news@Urmel.Informatik.RWTH-Aachen.DE (Newsfiles Owner)
- Nntp-Posting-Host: tabaqui
- Organization: Rechnerbetrieb Informatik / RWTH Aachen
- References: <1992Sep14.203355.20114@noose.ecn.purdue.edu>
- Date: Tue, 15 Sep 92 13:52:22 GMT
- Lines: 20
-
- Gautham K. Kudva writes:
-
- >this. Richard Stevens' "UNIX Network Programming" says that sleep can
- >interact with a process' own SIGALRM handlers; but no details are given.
- >I haven't found anything on these lines in the man pages either. So is there
- >any way in which my signal handler can peacefully co-exist with sleep()?
- >Or do I need to replace all sleep calls (using defines or something)
- >with my custom sleep function which handles alarms right?
-
- I'm afraid using a custom sleep() is the only portable solution. At least that
- was the conclusion I reached after inspecting the sleep() and SIGALRM
- implementations on several machines.
-
- It basically boils down to recomputing the alarm() time after every sleep()
- has finished and to compensate for the slept seconds.
- --
- Sincerely, berg@pool.informatik.rwth-aachen.de
- Stephen R. van den Berg (AKA BuGless). berg@physik.tu-muenchen.de
-
- "I have a *cunning* plan!"
-