6 time_t mktime(struct tm *tm)
10 long long t = __tm_to_secs(tm);
12 __secs_to_zone(t, 1, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
14 if (tm->tm_isdst>=0 && new.tm_isdst!=tm->tm_isdst)
15 t += opp - new.__tm_gmtoff;
18 if ((time_t)t != t) goto error;
20 __secs_to_zone(t, 0, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
22 if (__secs_to_tm(t - new.__tm_gmtoff, &new) < 0) goto error;