- extern int __use_tzfile;
- extern int __tz_compute __P ((time_t timer, struct tm *tp));
- extern int __tzfile_compute __P ((time_t timer,
- long int *leap_correct, int *leap_hit));
- register struct tm *tp;
- long int leap_correction;
- int leap_extra_secs;
-
- if (timer == NULL)
- {
- errno = EINVAL;
- return NULL;
- }
-
- {
- /* Make sure the database is initialized. */
- extern int __tzset_run;
- if (! __tzset_run)
- __tzset ();
- }
-
- if (__use_tzfile)
- {
- if (! __tzfile_compute (*timer, &leap_correction, &leap_extra_secs))
- return NULL;
- }
- else
- {
- tp = gmtime (timer);
- if (tp == NULL)
- return NULL;
-
- if (! __tz_compute (*timer, tp))
- return NULL;
+ return __tz_convert (t, 1, tp);
+}
+weak_alias (__localtime_r, localtime_r)