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:
Nick Ing-Simmons
Date:
January 28, 2003 05:08
Subject:
Re: [perl #20525] Perl's stdio layer doesn't handle EINTR
Message ID:
20030128130721.2002.3@bactrian.elixent.com
Michael Schroeder <mls@suse.de> writes:
>> 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). 

Several people have complained - but as the perl < 5.8 use of signals
is proven to cause core-dumps if you use %SIG it was decided that the 
new scheme was better. Will be better still when we get the bugs out ;-)

>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".

Agreed in principle - do you have a verified patch for perlio.c to hand?

-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


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