+
+ my $nr = 2 * 1024 * 1024;
+ while (1) {
+ vec(my $vec = '', $nr * 8 - 1, 1) = 1;
+ my $n = $send->($s1, [], $vec, $flag);
+ if (defined($n)) {
+ $n == length($vec) or
+ fail "short send: $n != ".length($vec);
+ diag "sent $nr, retrying with more";
+ $nr += 2 * 1024 * 1024;
+ } else {
+ ok($!{EMSGSIZE} || $!{ENOBUFS},
+ 'got EMSGSIZE or ENOBUFS') or
+ diag "$nr bytes fails with: $!";
+ last;
+ }
+ }