Discussion:
[perl.git] branch blead, updated. GitLive-blead-667-gec4d613
(too old to reply)
Craig A. Berry
2009-02-21 20:49:46 UTC
Permalink
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ec4d613228615e5a9cc9bc190eb78ec02aadcda0?hp=3aaf6557bbee1b4253a365839e7074c1efc18213>

- Log -----------------------------------------------------------------
commit ec4d613228615e5a9cc9bc190eb78ec02aadcda0
Author: Craig A. Berry <***@mac.com>
Date: Sat Feb 21 14:46:27 2009 -0600

Use "system" gmtime in time64 on VMS so C<vmsish 'time'> pragma works.

It's not really the system gmtime; it's the homegrown one in vms/vms.c
that checks hints and does shifting between UTC and local time when
requested.
-----------------------------------------------------------------------

Summary of changes:
time64_config.h | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/time64_config.h b/time64_config.h
index 4032acd..6a1cd9d 100644
--- a/time64_config.h
+++ b/time64_config.h
@@ -60,10 +60,13 @@
USE_SYSTEM_GMTIME
Should we use the system functions if the time is inside their range?
Your system localtime() is probably more accurate, but our gmtime() is
- fast and safe.
+ fast and safe. Except on VMS, where we need the homegrown gmtime()
+ override to shift between UTC and local for the vmsish 'time' pragma.
*/
#define USE_SYSTEM_LOCALTIME
-/* #define USE_SYSTEM_GMTIME */
+#ifdef VMS
+# define USE_SYSTEM_GMTIME
+#endif


/* SYSTEM_LOCALTIME_MAX

--
Perl5 Master Repository
Craig A. Berry
2009-02-22 22:45:43 UTC
Permalink
Post by Craig A. Berry
In perl.git, the branch blead has been updated
<http://perl5.git.perl.org/perl.git/commitdiff/ec4d613228615e5a9cc9bc190eb78ec02aadcda0?hp=3aaf6557bbee1b4253a365839e7074c1efc18213
- Log
-----------------------------------------------------------------
commit ec4d613228615e5a9cc9bc190eb78ec02aadcda0
Date: Sat Feb 21 14:46:27 2009 -0600
Use "system" gmtime in time64 on VMS so C<vmsish 'time'> pragma works.
It's not really the system gmtime; it's the homegrown one in vms/vms.c
that checks hints and does shifting between UTC and local time when
requested.
-----------------------------------------------------------------------
As I understand the code in time64.c, with this change, it only uses
the "system" or vms.c localtime and gmtime calls for dates less than
2106. For older dates, it will use it's own which are not taking
into account the VMSISH time pragma.
Hmm. I thought the claim was that it would shift time values from
outside the range localtime() and gmtime() can handle into equivalent
spots inside the range to do manipulations, then shift them back
again. But it's pretty easy to test that and it turns out you are
right. Within the range, the pragma does get the offset here in
Chicago ok:

$ perl -e "use vmsish 'time'; print scalar gmtime(2147483647);"
Tue Jan 19 09:14:07 2038
$ perl -e "print scalar gmtime(2147483647);"
Tue Jan 19 03:14:07 2038

But add one second to that and the pragma no longer does anything:

$ perl -e "use vmsish 'time'; print scalar gmtime(2147483648);"
Tue Jan 19 03:14:08 2038
$ perl -e "print scalar gmtime(2147483648);"
Tue Jan 19 03:14:08 2038

And the reason it breaks at 2038 instead of 2106 is that we have the
wrong values configured:

$ search configure.com TIME_max
$ WC "sGMTIME_max='2147483647'"
$ WC "sLOCALTIME_max='2147483647'"

That part's easy to fix. Understanding the time64 code well enough to
implement the vmsish pragma beyond 2106 is a TODO. Probably not that
hard but also probably not that urgent a priority.
________________________________________
Craig A. Berry
mailto:***@mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser
John Malmberg
2009-02-22 15:08:39 UTC
Permalink
Post by Craig A. Berry
In perl.git, the branch blead has been updated
<http://perl5.git.perl.org/perl.git/commitdiff/ec4d613228615e5a9cc9bc190eb78ec02aadcda0?hp=3aaf6557bbee1b4253a365839e7074c1efc18213>
- Log -----------------------------------------------------------------
commit ec4d613228615e5a9cc9bc190eb78ec02aadcda0
Date: Sat Feb 21 14:46:27 2009 -0600
Use "system" gmtime in time64 on VMS so C<vmsish 'time'> pragma works.
It's not really the system gmtime; it's the homegrown one in vms/vms.c
that checks hints and does shifting between UTC and local time when
requested.
-----------------------------------------------------------------------
As I understand the code in time64.c, with this change, it only uses the
"system" or vms.c localtime and gmtime calls for dates less than 2106.
For older dates, it will use it's own which are not taking into account
the VMSISH time pragma.

-John
***@qsl.net
Personal Opinion Only

Loading...