mirror of git://sourceware.org/git/glibc.git
Bug 22639 reports localtime failing to handle time offset transitions
correctly in 2039 and later on platforms with 64-bit time_t.
The problem is the use of SECSPERDAY (constant 86400) in calculations
such as
t = ((year - 1970) * 365
+ /* Compute the number of leapdays between 1970 and YEAR
(exclusive). There is a leapday every 4th year ... */
+ ((year - 1) / 4 - 1970 / 4)
/* ... except every 100th year ... */
- ((year - 1) / 100 - 1970 / 100)
/* ... but still every 400th year. */
+ ((year - 1) / 400 - 1970 / 400)) * SECSPERDAY;
where t is of type time_t and year is of type int. Before my commit
|
||
|---|---|---|
| .. | ||
| bits/types | ||
| sys | ||
| Depend | ||
| Makefile | ||
| Versions | ||
| adjtime.c | ||
| alt_digit.c | ||
| asctime.c | ||
| bug-asctime.c | ||
| bug-asctime_r.c | ||
| bug-getdate1.c | ||
| bug-mktime1.c | ||
| clock.c | ||
| clocktest.c | ||
| ctime.c | ||
| ctime_r.c | ||
| datemsk | ||
| difftime.c | ||
| dysize.c | ||
| era.c | ||
| ftime.c | ||
| getdate.c | ||
| getitimer.c | ||
| gettimeofday.c | ||
| gmtime.c | ||
| lc-time-cleanup.c | ||
| localtime.c | ||
| mktime.c | ||
| offtime.c | ||
| setitimer.c | ||
| settimeofday.c | ||
| stime.c | ||
| strftime.c | ||
| strftime_l.c | ||
| strptime.c | ||
| strptime_l.c | ||
| test_time.c | ||
| time.c | ||
| time.h | ||
| timegm.c | ||
| timespec_get.c | ||
| tst-ftime.c | ||
| tst-ftime_l.c | ||
| tst-getdate.c | ||
| tst-mktime.c | ||
| tst-mktime2.c | ||
| tst-mktime3.c | ||
| tst-posixtz.c | ||
| tst-strftime.c | ||
| tst-strptime-whitespace.c | ||
| tst-strptime.c | ||
| tst-strptime2.c | ||
| tst-strptime3.c | ||
| tst-tzname.c | ||
| tst-y2039.c | ||
| tst_wcsftime.c | ||
| tzfile.c | ||
| tzset.c | ||
| wcsftime.c | ||
| wcsftime_l.c | ||