home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!caen!malgudi.oar.net!chemabs!jon
- From: jon@cas.org (Jon Vander Hill)
- Subject: Re: timing problem with $SIG{'CHLD'}
- In-Reply-To: ggr@nareen.acci.COM.AU's message of Sun, 13 Dec 1992 23:56:32 GMT
- Message-ID: <JON.92Dec14133250@cas.org>
- Sender: usenet@cas.org
- Organization: Chemical Abstracts Service, Columbus, Ohio
- References: <1992Dec9.102933.27264@hemlock.cray.com> <9=h2hs#@rpi.edu>
- <9234910.11586@mulga.cs.mu.OZ.AU>
- Date: Mon, 14 Dec 1992 18:32:50 GMT
- Lines: 33
-
- >>>>> On Sun, 13 Dec 1992 23:56:32 GMT, ggr@nareen.acci.COM.AU (Greg Rose) said:
-
- > In article <9=h2hs#@rpi.edu> nobled@rebecca.its.rpi.edu (David Noble) writes:
- >> until ($addr = accept(NS,S))
- >> { die $! unless $! eq 'Interrupted system call'; }
- >>
- >>Of course, this breaks if the text of the error message varies for
- >>different platforms. In that case, you would have to check for any
- >>variants on the interrupted system call message. Anybody know offhand
- >>whether the text of $! is defined by perl or the operating system?
-
- > My understanding is that the text of the error message comes from
- > somthing that (eg. IBM) vendors often change, but the *NUMBER*
- > associated with the error is defined by POSIX. So I always use
-
- > sub EINTR { 4; }
-
- > until ($addr = accept(NS,S)) {
- > die $! unless $! == &EINTR;
- > }
-
- Even more portable would be:
-
- require "errno.ph"; # assuming this has been added to your perl lib
-
- $EINTR = &EINTR; # this will fail if &EINTR is not defined
-
- until ($addr = accept(NS,S)) {
- die $! unless $! == $EINTR;
- }
-
- Jon Vander Hill
- jon@cas.org
-