my $child;
my $can_fork;
+my $has_perlio;
BEGIN {
chdir 't' if -d 't';
$SIG{INT} = sub {exit 0}; # You have 60 seconds. Your time starts now.
my $must_finish_by = time + 60;
my $remaining;
- while ($remaining = time - $must_finish_by) {
+ while (($remaining = $must_finish_by - time) > 0) {
sleep $remaining;
}
warn "Something unexpectedly hung during testing";
exit 1;
}
}
+ unless ($has_perlio = find PerlIO::Layer 'perlio') {
+ print <<EOF;
+# Since you don't have perlio you might get failures with UTF-8 locales.
+EOF
+ }
}
use Socket;
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_STREAM, PF_UNSPEC)")
or print "# \$\! = $!\n";
-binmode(LEFT, ":bytes");
-binmode(RIGHT, ":bytes");
+if ($has_perlio) {
+ binmode(LEFT, ":bytes");
+ binmode(RIGHT, ":bytes");
+}
my @left = ("hello ", "world\n");
my @right = ("perl ", "rules!"); # Not like I'm trying to bias any survey here.
{
local $SIG{ALRM} = sub { warn "EOF on right took over 3 seconds" };
local $TODO = "Known problems with unix sockets on $^O"
- if $^O eq 'hpux' || $^O eq 'unicosmk';
+ if $^O eq 'hpux' || $^O eq 'super-ux' || $^O eq 'unicosmk';
alarm 3;
$! = 0;
ok (eof RIGHT, "right is at EOF");
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_DGRAM, PF_UNSPEC)")
or print "# \$\! = $!\n";
-binmode(LEFT, ":bytes");
-binmode(RIGHT, ":bytes");
+if ($has_perlio) {
+ binmode(LEFT, ":bytes");
+ binmode(RIGHT, ":bytes");
+}
foreach (@left) {
# is (syswrite (LEFT, $_), length $_, "write " . _qq ($_) . " to left");