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