6 require Config; import Config;
7 if ($Config{'extensions'} !~ /\bPOSIX\b/) {
13 use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read write);
16 $mystdout = new_from_fd FileHandle 1,"w";
21 print $mystdout "ok ",fileno($mystdout),"\n";
22 write(1,"ok 2\nnot ok 2\n", 5);
24 $testfd = open("TEST", O_RDONLY, 0) and print "ok 3\n";
25 read($testfd, $buffer, 9) if $testfd > 2;
26 print $buffer eq "#!./perl\n" ? "ok 4\n" : "not ok 4\n";
29 print $fds[0] == $testfd + 1 ? "ok 5\n" : "not ok 5\n";
30 $writer = FileHandle->new_from_fd($fds[1], "w");
31 $reader = FileHandle->new_from_fd($fds[0], "r");
32 print $writer "ok 6\n";
37 $sigset = new POSIX::SigSet 1,3;
39 if (!ismember $sigset 1) { print "ok 7\n" }
40 if (ismember $sigset 3) { print "ok 8\n" }
41 $mask = new POSIX::SigSet &SIGINT;
42 $action = new POSIX::SigAction 'main::SigHUP', $mask, 0;
43 sigaction(&SIGHUP, $action);
44 $SIG{'INT'} = 'SigINT';
60 print &_POSIX_OPEN_MAX > $fds[1] ? "ok 13\n" : "not ok 13\n";
62 print getcwd() =~ m#/t$# ? "ok 14\n" : "not ok 14\n";
64 # Pick up whether we're really able to dynamically load everything.
65 print &POSIX::acos(1.0) == 0.0 ? "ok 15\n" : "not ok 15\n";
68 CORE::read(STDIN, $buf,1);
69 print $buf eq 'A' ? "ok 16\n" : "not ok 16\n";