Revision history for Perl extension Time::HiRes.
+1.71 - a thinko in the nanosleep() detection
+ - move more changes stuff from the README to Changes
+ - add -w to the Makefile.PL
+
1.70 - oops in 1.69 about @ISA (not affecting anything but silly)
- add copyright 2005 to HiRes.pm
- add copyright and license to HiRes.xs
- - add copyrights 2003,2004,2005 to README
+ - add copyrights 2003, 2004, 2005 to README
-1.69 - actually run a test for nanosleep since e.g. in AIX 4.2
+1.69 - actually run a test for nanosleep
+ (if there is no $Config{d_nanosleep}) since e.g. in AIX 4.2
it seems that one can link in nanosleep() but then calling
it fails instantly and sets errno to ENOSYS (Not implemented).
This may be fixable in the AIX case by figuring out the right
the IVSIZE might not be defined)
- define NVgf if needed
- grab the typemap from 5.8.0 for the NV stuff
+
+ 1.31 and 1.32 add more backward compatibility (now all the way
+ back to Perl 5.00404), and using nanosleep() (if available) for
+ subsecond sleeps.
+
1.30
- release 1.29_02 as 1.30
+ 1.30 adds all the changes made during the Perl 5.6->5.7->5.8
+ development cycle. Most notably portability across platforms has been
+ enhanced, and the interval timers (setitimer, getitimer) have been
+ added. Note that the version of Time::HiRes that is included in Perl
+ 5.8.0 calls itself 1.20_00, but it is equivalent to this Time::HiRes
+ version. Note also that in 1.30 Wegscheid turns over the maintenance
+ to Jarkko Hietaniemi.
+
1.29_02
- fix a silly unclosed comment typo in HiRes.xs
- hopefully correct "-lc" fix for SCO.
- add PPD stuff
+ 1.20 adds a platform neutral set of C accessible routines if you are
+ running 5.005+. All other changes are packaging changes and build
+ fixes(?) for statically linked Perl, SCO, and VMS.
+
1.19 Tue Sep 29 22:30 1998
- put VMS gettimeofday() in. Patch is from Sebastian Bazley
<seb@stian.demon.co.uk>
- fix Makefile.PL (more) so that detection of gettimeofday is
more correct.
+ 1.19 has better VMS support.
+
1.18 Mon Jul 6 22:40 1998
- add usleep() for Win32.
- fix Makefile.PL to fix reported HP/UX feature where unresolved
x bit set). Thanks to David Kozinn for report and explanation.
Problems with the fix are mine :)
+ 1.18 has limited Win32 support (no ualarm). Added usleep for Win32.
+ Probably buggy. I'm sure I'll hear.
+
1.17 Wed Jul 1 20:10 1998
- fix setitimer calls so microseconds is not more than 1000000.
Hp/UX 9 doesn't like that. Provided by Roland B Robert, PhD.
1.16 Wed Nov 12 21:05 1997
- add missing EXTEND in new gettimeofday scalar code.
+ 1.16+ should be closer to building out of the box on Linux. Thanks
+ to Gisle Aas for patches, and the ualarm equivalent using setitimer.
+
+ If your underlying operating system doesn't implement ualarm(), then
+ a fake using setitimer() will be made. If the OS is missing usleep(),
+ a fake one using select() will be made. If a fake can't be made for
+ either ualarm() or usleep(), then the corresponding Perl function will
+ not be available. If the OS is missing gettimeofday(), you will get
+ unresolved externals, either at link- or run-time.
+
+ This is an improvement; the package used to not even build if
+ you were missing any of these bits. Roderick Schertler
+
+ <roderick@argon.org> did all the conditional compilation stuff,
+ look at HiRes.pm and the test suites; it's good educational reading.
+
1.15 Mon Nov 10 21:30 1997
- HiRes.pm: update pod. Provided by Gisle Aas.
- HiRes.xs: if gettimeofday() called in scalar context, do
+#!/usr/bin/perl
+#
+# In general we trust %Config, but for nanosleep() this trust
+# may be misplaces (it may be linkable but not really functional).
+# Use $ENV{FORCE_NANOSLEEP_SCAN} to force rescanning whether there
+# really is hope.
+
require 5.002;
use Config;
my $VERBOSE = $ENV{VERBOSE};
my $DEFINE;
my $LIBS = [];
-my $XSOPT;
+my $XSOPT = '';
use vars qw($self); # Used in 'sourcing' the hints.
$tmp_exe);
printf "Running $abs_tmp_exe..." if $VERBOSE;
if (system($abs_tmp_exe) == 0) {
- $ok = $? == 0;
+ $ok = 1;
} else {
+ $ok = 0;
print "system('$abs_tmp_exe') failed: $?\n";
}
}
sub has_gettimeofday {
# confusing but true (if condition true ==> -DHAS_GETTIMEOFDAY already)
- return 0 if $Config{d_gettimeod} eq 'define';
+ return 0 if $Config{d_gettimeod};
return 1 if try_compile_and_link(<<EOM);
#include "EXTERN.h"
#include "perl.h"
}
sub has_nanosleep {
+ print "Trying out nanosleep... ";
return 1 if
try_compile_and_link(<<EOM, run => 1);
#include <time.h>
int main() {
struct timespec ts1, ts2;
+ int ret;
ts1.tv_sec = 0;
ts1.tv_nsec = 750000000;
ts2.tv_sec = 0;
ts2.tv_nsec = 0;
- nanosleep(&ts1, &ts2); /* E.g. in AIX nanosleep() might return ENOSYS. */
- exit(errno);
+ errno = 0;
+ ret = nanosleep(&ts1, &ts2); /* E.g. in AIX nanosleep() fail and set errno to ENOSYS. */
+ ret == 0 ? exit(0) : exit(errno ? errno : -1);
}
EOM
}
} else {
print "NOT found.\n";
print "Let's see if you have select()... ";
- if ($Config{'d_select'} eq 'define') {
+ if ($Config{'d_select'}) {
print "found.\n";
print "We can make a Time::HiRes::usleep().\n";
} else {
print "Looking for nanosleep()... ";
my $has_nanosleep;
- if (exists $Config{d_nanosleep}) {
+ if (exists $Config{d_nanosleep} && !$ENV{FORCE_NANOSLEEP_SCAN}) {
+ # Believe $Config{d_nanosleep}.
if ($Config{d_nanosleep}) {
$has_nanosleep++;
$DEFINE .= ' -DTIME_HIRES_NANOSLEEP';