Front page | perl.perl5.porters |
Postings from May 2012
Re: [perl #5971] IO::Handle setvbuf bug
Thread Previous
|
Thread Next
From:
Nicholas Clark
Date:
May 8, 2012 06:52
Subject:
Re: [perl #5971] IO::Handle setvbuf bug
Message ID:
20120508135151.GK9069@plum.flirble.org
On Tue, May 08, 2012 at 09:54:20AM +1000, Tony Cook wrote:
> On Sat, May 05, 2012 at 04:59:02AM -0700, Brian Fraser via RT wrote:
> > On Wed Jul 28 20:27:39 2010, greerga wrote:
> > > This isn't "PerlIO" per se because the documentation notes:
> > >
> > > - - - 8< - - - 8< - - -
> > > WARNING: The IO::Handle::setvbuf() is not available by default on Perls
> > > 5.8.0 and later because setvbuf() is rather specific to using the stdio
> > > library, while Perl prefers the new perlio subsystem instead.
> > > - - - 8< - - - 8< - - -
> > >
> > > Indeed on Linux I get:
> > > IO::Handle::setvbuf not implemented on this architecture at -e line 1.
> >
> > How would I need to compile Perl to test if this is still present?
>
> You'd have to build perl without perlio, but Configure now always
> enables perlio.
"Now" as in post 5.15.0
If I build 5.14.0 like this:
./Configure -de -Uuseperlio && make -j5 test_prep
I see the same confusing difference:
$ strace -oout -ewrite ./perl -Ilib -wle 'use IO::Handle '_IOLBF'; STDERR->setvbuf(my $buffer_var, _IOLBF, 1024); print STDERR "hoidyhu", "wowgrrr"'
hoidyhuwowgrrr
$ cat out
write(2, "hoidyhuwowgrrr\n", 15) = 15
$ strace -oout -ewrite ./perl -Ilib -wle 'use IO::Handle '_IOLBF'; STDERR->setvbuf($buffer_var, _IOLBF, 1024); print STDERR "hoidyhu", "wowgrrr"'
Name "main::buffer_var" used only once: possible typo at -e line 1.
hoidyhuwowgrrr
$ cat out
write(2, "Name \"main::buffer_var\" used onl"..., 68) = 68
write(2, "h", 1) = 1
write(2, "oidyhu", 6) = 6
write(2, "w", 1) = 1
write(2, "owgrrr", 6) = 6
write(2, "\n", 1) = 1
Nicholas Clark
Thread Previous
|
Thread Next