Even if the F_GETPIPE_SZ constant is defined, the fcntl() call can
fail (e.g. with EINVAL), so fall back to the default in that case.
# consistently failing. At exactly 0x100000 it started passing
# 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 {
+my $surely_this_arbitrary_number_is_fine = (eval {
use Fcntl qw(F_GETPIPE_SZ);
- fcntl($out, F_GETPIPE_SZ, 0) + 1;
-} || 0x100000;
+ fcntl($out, F_GETPIPE_SZ, 0);
+} || 0xfffff) + 1;
# close during print