"Craig A. Berry" <[EMAIL PROTECTED]> writes: > It turns out there are several functions available in the C library in > recent versions of VMS that we've been saying we don't have. After the > patch below we fail some Time::HiRes tests that we formerly skipped (hope to > have another patch for those soon) but otherwise this causes us no problems.
For those of us with older versions of VMS, I've cooked up a patch that implements ualarm with native VMS calls. But, like Craig, I've seen a lot of test errors appear. They all seem to arise from the use of "signal()" and its "one-shot" nature. So even without Time::HiRes, if we do something like: $SIG{ALRM} = sub { print "signal handled!\n"; } ; alarm(2); sleep(4); # SIGALRM fires during sleep alarm(2); sleep(4); # SIGALRM fires during sleep on the second SIGALRM, there's an error exit with stack dump because the SIGALRM isn't caught by the handler ... since we didn't reset the signal handler after the first signal. Now a question to the wider Perl community: is that what one should expect from %SIG? Should SIG handlers be one-shot, or persistent? I have the *suspicion* that it is expected that handlers are persistent, because otherwise the test code in HiRes: local $SIG{ALRM} = sub { $tick++ }; my $one = time; $tick = 0; ualarm(10_000); sleep until $tick; my $two = time; $tick = 0; ualarm(10_000); sleep until $tick; would clearly fail on the second ualarm. Unfortunately the docs aren't very clear on this point. -- Drexel University \V --Chuck Lane ======]---------->--------*------------<-------[=========== (215) 895-1545 _/ \ Particle Physics FAX: (215) 895-5934 /\ /~~~~~~~~~~~ [EMAIL PROTECTED]