7 if ($Config{'extensions'} !~ /\bIO\b/) {
8 print "1..0 # Skip: IO extension not built\n";
14 use Test::More tests => 5;
18 $x = new_tmpfile IO::File;
19 ok($x, "new_tmpfile");
23 is($line, "ok 2\n", "check we can write to the tempfile");
26 print $x "not ok 3\n";
32 is($line, "ok 3\n", "test getpos/setpos");
36 ok($!, "setpos(undef) makes errno non-zero");
39 { # [perl #64772] IO::Handle->sync fails on an O_RDONLY descriptor
41 or skip "No fsync", 1;
42 $^O =~ /^(?:aix|irix)$/
43 and skip "fsync() documented to fail on non-writable handles on $^O", 1;
45 and skip "fsync() on cygwin uses FlushFileBuffers which requires a writable handle", 1;
46 open my $fh, "<", "t/io_xs.t"
47 or skip "Cannot open t/io_xs.t read-only: $!", 1;
48 ok($fh->sync, "sync to a read only handle")
49 or diag "sync(): ", $!;