Grant Update: y2038 fix

From a mail on Perl 5 Porters:

Attached is the latest 2038 patch from the y2038 branch.

  • Configure now probes for the safe range of the system's localtime() and gmtime(). Perl will use the system functions inside their safe range. [Thanks Merijn]
  • Perl now ships with its own 64 bit gmtime() and timegm().
  • localtime() is made 2038 safe on 32 bit systems using the algorithm described here http://code.google.com/p/y2038/wiki/HowItWorks
  • Time::Local can now handle past 2038.
  • Time::gmtime tests improved and expanded past 2038 and 1901.
  • Time::localtime tests improved and expanded past 2038.

Open issues

  • localtime64.h and .c need to be wired into the Makefile. I don't now how to do this.
  • The LOCALTIME_EDGECASE_BROKEN special case needs to be reincorporated.
  • This has not been tested on a system with an unsigned or floating point time_t.
  • The configure probes are probably broken with a floating point time_t.

Other notes

  • The clever way Time::Local handles the year (8, 108 and 2008 are all 2008) means there are gaps in what years you can run through timelocal() and timegm().
  • Since localtime64.c now has its own timegm() core time modules could make use of it.

I've hit the limit of what I can do alone. I'd like to see this incorporated into the bleadperl trunk so it can get some cross-platform testing.

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at www.perlfoundation.org.

About this Entry

This page contains a single entry by Alberto Simões published on September 23, 2008 7:27 PM.

Running Grants (2008 - IV) was the previous entry in this blog.

2008Q4 Call for Grants Proposals is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38