develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #119097] print returning EINTR in 5.14

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
August 11, 2013 12:55
Subject:
Re: [perl #119097] print returning EINTR in 5.14
Message ID:
CAHhgV8j6pD-T8SiVFfU0N2R0TZgg1qEzhMHrLkf1pkhvY7RL_A@mail.gmail.com
On Sun, Aug 11, 2013 at 3:18 PM, Victor Efimov via RT
<perlbug-followup@perl.org> wrote:
> Also,
>
> (1)
>
> http://perldoc.perl.org/perlipc.html#Deferred-Signals-%28Safe-Signals%29
>> the solution is to use the :perlio layer to do IO--at least on those
> handles that you want to be able to break into with signals.
>
> http://perldoc.perl.org/PerlIO.html
>> The default can be overridden by setting the environment variable
> PERLIO to a space separated list of layers
>
> it seems that the test initially had
>  binmode $fh, ":perlio";

binmode $fh, ":perlio" is conceptually nonsensical. You want to
specify that during open, but that's broken too :-/

> but PERLIO=stdio overrides this.
> so phrase "The default can be overridden by setting the environment
> variable PERLIO" does not look correct. Not only default is overriden,
> but any atempt to use the layer.

No, it doesn't. What you're doing is effectively both:
":stdio:perlio". This will generally block unless you're reading the
buffer size(Because :perlio is assuming read sementics underneath it,
not fread semantics). This is a known issue that can't be fixed (stdio
just sucks like that).

You can kind of fix it with a «use open IO => ":pop:perlio";», it
isn't pretty but I'm not sure what else would do the trick. PerlIO
sucks like that.

Leon

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