I'm trying to use the timezone stuff you maintain on a 64-bit Alpha running Linux. It builds fine, but the timezone compiler has some trouble (it runs forever). I tracked the problem down to this code from timesub(): if (days >= 0) for ( ; ; ) { yleap = isleap(y); if (days < (long) year_lengths[yleap]) break; ++y; days = days - (long) year_lengths[yleap]; } else do { --y; yleap = isleap(y); days = days + (long) year_lengths[yleap]; } while (days < 0); This works fine when the number of years you can represent is small, as it is on a 32 bit machine. On a 64-bit machine however, you have some 4 billion more years to worry about. That means this loop has to repeat well over 4 billion times, and that takes 1 while :-) Any ideas on how to fix this? Erik ------------------------------------------------------------------------------- "Eggheads unite! You have nothing to lose but your yolks" - Adlai Stevenson Erik Troan = http://sunsite.unc.edu/ewt/ = ewt@sunsite.unc.edu
"Erik" == Erik Troan <ewt@redhat.com> writes: Erik> I'm trying to use the timezone stuff you maintain on a 64-bit Alpha Erik> running Linux. It builds fine, but the timezone compiler has some Erik> trouble (it runs forever). I tracked the problem down to this code from Erik> timesub():
Are you sure this is the problem? Last I heard, the tzcode works fine on NetBSD/alpha (I integrated it into the NetBSD C library virtually unchanged). --jtc
On Wed, 18 Oct 1995, J.T. Conklin wrote:
Are you sure this is the problem? Last I heard, the tzcode works fine on NetBSD/alpha (I integrated it into the NetBSD C library virtually unchanged).
I'm not positive, but I'm pretty sure. Does NetBSD/alpha use 64 bit time_t or 32 bit? If it uses only 32 time bits, that would explain this. Looking at the logic of the loop I pointed out makes me feel suspicious though. It does something once for every year in the system's time domain. A 64-bit time field has a *lot* of years (over 100 trillion). Erik ------------------------------------------------------------------------------- "Eggheads unite! You have nothing to lose but your yolks" - Adlai Stevenson Erik Troan = http://sunsite.unc.edu/ewt/ = ewt@sunsite.unc.edu
Are you sure this is the problem? Last I heard, the tzcode works fine on NetBSD/alpha (I integrated it into the NetBSD C library virtually unchanged).
I'm not positive, but I'm pretty sure.
Does NetBSD/alpha use 64 bit time_t or 32 bit? If it uses only 32 time bits, that would explain this.
NetBSD, like Digital UNIX, uses a 32-bit time_t. cgd
On Wed, 18 Oct 1995, Chris G Demetriou wrote:
Are you sure this is the problem? Last I heard, the tzcode works fine on NetBSD/alpha (I integrated it into the NetBSD C library virtually unchanged).
I'm not positive, but I'm pretty sure.
Does NetBSD/alpha use 64 bit time_t or 32 bit? If it uses only 32 time bits, that would explain this.
NetBSD, like Digital UNIX, uses a 32-bit time_t.
That explains the problems I'm seeing then. Linux uses 64 bit time on Alphas. Is there a chance of getting a 64 bit fix for the timezone stuff? Erik ------------------------------------------------------------------------------- "Eggheads unite! You have nothing to lose but your yolks" - Adlai Stevenson Erik Troan = http://sunsite.unc.edu/ewt/ = ewt@sunsite.unc.edu
participants (3)
-
Chris G Demetriou -
Erik Troan -
J.T. Conklin