This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: A patch for mktime.c and tz*.c.
- To: eggert@twinsun.com (Paul Eggert)
- Subject: Re: A patch for mktime.c and tz*.c.
- From: hjl@lucon.org (H.J. Lu)
- Date: Fri, 6 Nov 1998 19:28:15 -0800 (PST)
- Cc: drepper@cygnus.com, libc-hacker@cygnus.com
> The patch that you sent does not behave the way that you describe.
> E.g. the patch has __tzfile_read set __daylight. But this action
> occurs rarely, only at the start of the program, and after TZ changes;
> it doesn't occur for each ``given time''. So (in general) it will
> disagree with the difference between standard time and DST at ``the
> given time''.
>
That is absolutely false. In glibc 2
/* Convert *TP to a time_t value. */
time_t
mktime (tp)
struct tm *tp;
{
#ifdef _LIBC
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
time zone names contained in the external variable `tzname' shall
be set as if the tzset() function had been called. */
__tzset ();
#endif
return __mktime_internal (tp, localtime_r, &localtime_offset);
}
--
H.J. Lu (hjl@gnu.org)