@@ -56,9 +56,16 @@ extern time_t __mktime_internal (struct tm *__tp,
struct tm *(*__func) (const time_t *,
struct tm *),
long int *__offset) attribute_hidden;
+
+#if __TIMESIZE == 64
+# define __localtime64 localtime
+#else
+extern struct tm *__localtime64 (const __time64_t *__timer);
+libc_hidden_proto (__localtime64)
+#endif
+
extern struct tm *__localtime_r (const time_t *__timer,
struct tm *__tp) attribute_hidden;
-
extern struct tm *__gmtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp);
libc_hidden_proto (__gmtime_r)
@@ -21,7 +21,6 @@
/* The C Standard says that localtime and gmtime return the same pointer. */
struct tm _tmbuf;
-
/* Return the `struct tm' representation of *T in local time,
using *TP to store the result. */
struct tm *
@@ -31,11 +30,23 @@ __localtime_r (const time_t *t, struct tm *tp)
}
weak_alias (__localtime_r, localtime_r)
-
/* Return the `struct tm' representation of *T in local time. */
+struct tm *
+__localtime64 (const __time64_t *t)
+{
+ return __tz_convert (*t, 1, &_tmbuf);
+}
+libc_hidden_def (__localtime64)
+
+/* Provide a 32-bit variant if needed */
+
+#if __TIMESIZE != 64
+
struct tm *
localtime (const time_t *t)
{
return __tz_convert (*t, 1, &_tmbuf);
}
libc_hidden_def (localtime)
+
+#endif