8 # A modest test: exercises only O_WRONLY, O_CREAT, and O_RDONLY.
9 # Have to be modest to be portable: could possibly extend testing
10 # also to O_RDWR and O_APPEND, but dunno about the portability of,
11 # say, O_TRUNC and O_EXCL, not to mention O_NONBLOCK.
19 if (sysopen(my $wo, "fcntl$$", O_WRONLY|O_CREAT)) {
21 if (syswrite($wo, "foo") == 3) {
24 if (sysopen(my $ro, "fcntl$$", O_RDONLY)) {
26 if (sysread($ro, my $read, 3)) {
31 print "not ok 6 # content '$read' not ok\n";
34 print "not ok 5 # sysread failed: $!\n";
37 print "not ok 4 # sysopen O_RDONLY failed: $!\n";
41 print "not ok 3 # syswrite failed: $!\n";
45 print "not ok 2 # sysopen O_WRONLY failed: $!\n";
49 1 while unlink "fcntl$$";