summaryrefslogtreecommitdiff
path: root/time/localtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/localtime.c')
-rw-r--r--time/localtime.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/time/localtime.c b/time/localtime.c
index 8684a8a971..af5fba02ed 100644
--- a/time/localtime.c
+++ b/time/localtime.c
@@ -1,5 +1,5 @@
/* Convert `time_t' to `struct tm' in local time zone.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <time.h>
@@ -25,17 +25,46 @@ struct tm _tmbuf;
/* Return the `struct tm' representation of *T in local time,
using *TP to store the result. */
struct tm *
+__localtime64_r (const __time64_t *t, struct tm *tp)
+{
+ return __tz_convert (*t, 1, tp);
+}
+
+/* Provide a 32-bit variant if needed. */
+
+#if __TIMESIZE != 64
+
+struct tm *
__localtime_r (const time_t *t, struct tm *tp)
{
- return __tz_convert (t, 1, tp);
+ __time64_t t64 = *t;
+ return __localtime64_r (&t64, tp);
}
+libc_hidden_def (__localtime64_r)
+
+#endif
+
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);
+ __time64_t t64 = *t;
+ return __localtime64 (&t64);
}
libc_hidden_def (localtime)
+
+#endif