Cygwin fsync() is implemented in terms of the Win32 FlushFileBuffers()
API which requires GENERIC_WRITE access.
or skip "No fsync", 1;
$^O eq 'aix'
and skip "fsync() documented to fail on non-writable handles on AIX", 1;
+ $^O eq 'cygwin'
+ and skip "fsync() on cygwin uses FlushFileBuffers which requires a writable handle", 1;
open my $fh, "<", "t/io_xs.t"
or skip "Cannot open t/io_xs.t read-only: $!", 1;
- ok($fh->sync, "sync to a read only handle");
+ ok($fh->sync, "sync to a read only handle")
+ or diag "sync(): ", $!;
}