In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/e78728e52f52b72a7e081d0b464a51a25d0ea6e9?hp=f0614d30a9ff5dcdc10edf6f298042c5dd60d5d3>

- Log -----------------------------------------------------------------
commit e78728e52f52b72a7e081d0b464a51a25d0ea6e9
Author: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
Date:   Wed Oct 8 20:58:05 2014 +0100

    Add support for Linux pipe buffer size fcntl commands
    
    This lets us make t/io/eintr.t more reliable by making sure we're
    actually writing more than the buffer size.
-----------------------------------------------------------------------

Summary of changes:
 ext/Fcntl/Fcntl.pm    | 4 +++-
 ext/Fcntl/Makefile.PL | 4 ++--
 t/io/eintr.t          | 8 ++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index b1e0762..fa5f393 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -61,7 +61,7 @@ our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
 require Exporter;
 require XSLoader;
 @ISA = qw(Exporter);
-$VERSION = '1.12';
+$VERSION = '1.13';
 
 XSLoader::load();
 
@@ -169,9 +169,11 @@ XSLoader::load();
        DN_MULTISHOT
        DN_RENAME
        F_GETLEASE
+       F_GETPIPE_SZ
        F_GETSIG
        F_NOTIFY
        F_SETLEASE
+       F_SETPIPE_SZ
        F_SETSIG
        LOCK_MAND
        LOCK_READ
diff --git a/ext/Fcntl/Makefile.PL b/ext/Fcntl/Makefile.PL
index c42aa51..ccd90c9 100644
--- a/ext/Fcntl/Makefile.PL
+++ b/ext/Fcntl/Makefile.PL
@@ -14,10 +14,10 @@ my @names = (qw(
               FRSYNC FSYNC FTRUNC F_ALLOCSP F_ALLOCSP64 F_COMPAT
               F_DUP2FD F_DUPFD F_EXLCK F_FREESP F_FREESP64 F_FSYNC
               F_FSYNC64 F_GETFD F_GETFL F_GETLEASE F_GETLK F_GETLK64
-              F_GETOWN F_GETSIG F_NODNY F_NOTIFY F_POSIX F_RDACC
+              F_GETOWN F_GETPIPE_SZ F_GETSIG F_NODNY F_NOTIFY F_POSIX F_RDACC
               F_RDDNY F_RDLCK F_RWACC F_RWDNY F_SETFD F_SETFL
               F_SETLEASE F_SETLK F_SETLK64 F_SETLKW F_SETLKW64
-              F_SETOWN F_SETSIG F_SHARE F_SHLCK F_UNLCK F_UNSHARE
+              F_SETOWN F_SETPIPE_SZ F_SETSIG F_SHARE F_SHLCK F_UNLCK F_UNSHARE
               F_WRACC F_WRDNY F_WRLCK LOCK_MAND LOCK_READ LOCK_WRITE
               LOCK_RW O_ACCMODE O_ALIAS O_ALT_IO O_APPEND O_ASYNC O_BINARY
               O_CREAT O_DEFER O_DIRECT O_DIRECTORY O_DSYNC O_EVTONLY O_EXCL
diff --git a/t/io/eintr.t b/t/io/eintr.t
index 32f109d..6e99ac0 100644
--- a/t/io/eintr.t
+++ b/t/io/eintr.t
@@ -97,8 +97,12 @@ ok(close($in), 'read/die: close status');
 
 # This used to be 1_000_000, but on Linux/ppc64 (POWER7) this kept
 # consistently failing. At exactly 0x100000 it started passing
-# again. We're hoping this number is bigger than any pipe buffer.
-my $surely_this_arbitrary_number_is_fine = 0x100000;
+# again. Now we're asking the kernel what the pipe buffer is, and if
+# that fails, hoping this number is bigger than any pipe buffer.
+my $surely_this_arbitrary_number_is_fine = eval {
+    use Fcntl qw(F_GETPIPE_SZ);
+    fcntl($out, F_GETPIPE_SZ, 0) + 1;
+} || 0x100000;
 
 # close during print
 

--
Perl5 Master Repository

Reply via email to