develooper Front page | perl.perl5.porters | Postings from January 2003

Re: [perl #20525] Perl's stdio layer doesn't handle EINTR

Thread Previous | Thread Next
From:
Michael Schroeder
Date:
January 27, 2003 05:04
Subject:
Re: [perl #20525] Perl's stdio layer doesn't handle EINTR
Message ID:
20030127105952.GA12433@suse.de
> This is a side effect of the "safe signals" support.
> I "had" to turn off SA_RESTART so that syscall would resturn and give us 
> a chance to execute the perl level %SIG handler.

Yes, actually I have complained about breaking compatibility a few
weeks ago (it was about an EINTR in an accept() call, yes, a bit of an
esoteric case). But the current problem is

1) probably causing many people headaches, as it is easily to
   trigger.

2) easy to fix. Just retry the stdio call if fgets() returns EOF /
   fread() returns zero and errno is EINTR. You should probably
   clear errno before the call "just in case".

Cheers,
  Michael.

-- 
Michael Schroeder                                   mls@suse.de
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About