From: Jarkko Hietaniemi Date: Thu, 29 May 2003 08:11:42 +0000 (+0000) Subject: Document that setvbuf() is not probably any more available. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=284196a30160ee3fc7affa3eed3ebbd21309fd83;p=p5sagit%2Fp5-mst-13.2.git Document that setvbuf() is not probably any more available. Many reports, most recently by mjd in [perl #22339] IO::Handle::setvbuf not defined properly p4raw-id: //depot/perl@19631 --- diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index 81bec5a..29b8316 100644 --- a/ext/IO/lib/IO/Handle.pm +++ b/ext/IO/lib/IO/Handle.pm @@ -20,6 +20,7 @@ IO::Handle - supply object methods for I/O handles $io->print("Some text\n"); } + # setvbuf is not available by default on Perls 5.8.0 and later. use IO::Handle '_IOLBF'; $io->setvbuf($buffer_var, _IOLBF, 1024); @@ -193,6 +194,10 @@ C<_IOLBF>, and C<_IONBF> for setvbuf()--except that the buffer parameter specifies a scalar variable to use as a buffer. You should only change the buffer before any I/O, or immediately after calling flush. +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. + WARNING: A variable used as a buffer by C or C B in any way until the IO::Handle is closed or C or C is called again, or memory corruption may result! Remember that