home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7430 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!munnari.oz.au!metro!usage!spectrum!cameron
  3. From: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson)
  4. Subject: Re: timing problem with $SIG{'CHLD'}
  5. Message-ID: <1992Dec15.062547.4902@usage.csd.unsw.OZ.AU>
  6. Sender: news@usage.csd.unsw.OZ.AU
  7. Nntp-Posting-Host: fuligin.spectrum.cs.unsw.oz.au
  8. Reply-To: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson)
  9. Organization: CS&E Computing Facility, Uni Of NSW, Oz
  10. References: <1992Dec9.102933.27264@hemlock.cray.com> <9=h2hs#@rpi.edu> <9234910.11586@mulga.cs.mu.OZ.AU>
  11. Date: Tue, 15 Dec 1992 06:25:47 GMT
  12. Lines: 34
  13.  
  14. nobled@rebecca.its.rpi.edu (David Noble) writes:
  15. |     until ($addr = accept(NS,S))
  16. |     { die $! unless $! eq 'Interrupted system call'; }
  17. | Of course, this breaks if the text of the error message varies for
  18. | different platforms. In that case, you would have to check for any
  19. | variants on the interrupted system call message. Anybody know offhand
  20. | whether the text of $! is defined by perl or the operating system?
  21.  
  22. ggr@nareen.acci.COM.AU (Greg Rose) writes:
  23. | My understanding is that the text of the error message comes from
  24. | somthing that (eg. IBM) vendors often change, but the *NUMBER*
  25. | associated with the error is defined by POSIX. So I always use
  26. | sub EINTR { 4; }
  27. | until ($addr = accept(NS,S)) {
  28. |     die $! unless $! == &EINTR;
  29. | }
  30.  
  31. Better still,
  32.  
  33.     require 'errno.ph';
  34.  
  35.     until ($addr = accept(NS,S)) {
  36.         die $! unless $! == &EINTR;
  37.     }
  38.  
  39. since the name should be even stabler.
  40.     - Cameron Simpson
  41.       cameron@cs.unsw.oz.au, DoD 0743
  42. --
  43. "The engine purrs beneath me with a purpose,
  44.  ready for the pleasure of my hand upon the throttle." - Peter Smith
  45.