summaryrefslogtreecommitdiff
path: root/time/gmtime.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-16 21:19:30 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-16 21:19:30 +0100
commit10f1958417a4944a60a08230eae6a639209d52f8 (patch)
tree7662166d1cf40507e65fba6dbb9ee73a7c652afc /time/gmtime.c
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
parenta2e487ce1c59d19345d9ecacc58de79febd869e4 (diff)
Merge branch 'master' of git://sourceware.org/git/glibc into upstreamupstream
Diffstat (limited to 'time/gmtime.c')
-rw-r--r--time/gmtime.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/time/gmtime.c b/time/gmtime.c
index dc33b3e68a..0d282bab6a 100644
--- a/time/gmtime.c
+++ b/time/gmtime.c
@@ -1,5 +1,5 @@
/* Convert `time_t' to `struct tm' in UTC.
- 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,24 +14,54 @@
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>
/* Return the `struct tm' representation of *T in UTC,
using *TP to store the result. */
struct tm *
+__gmtime64_r (const __time64_t *t, struct tm *tp)
+{
+ return __tz_convert (*t, 0, tp);
+}
+
+/* Provide a 32-bit variant if needed. */
+
+#if __TIMESIZE != 64
+
+libc_hidden_def (__gmtime64_r)
+
+struct tm *
__gmtime_r (const time_t *t, struct tm *tp)
{
- return __tz_convert (t, 0, tp);
+ __time64_t t64 = *t;
+ return __gmtime64_r (&t64, tp);
}
+
+#endif
+
libc_hidden_def (__gmtime_r)
weak_alias (__gmtime_r, gmtime_r)
+/* Return the `struct tm' representation of *T in UTC. */
+struct tm *
+__gmtime64 (const __time64_t *t)
+{
+ return __tz_convert (*t, 0, &_tmbuf);
+}
+
+/* Provide a 32-bit variant if needed. */
+
+#if __TIMESIZE != 64
+
+libc_hidden_def (__gmtime64)
-/* Return the `struct tm' representation of *T in UTC. */
struct tm *
gmtime (const time_t *t)
{
- return __tz_convert (t, 0, &_tmbuf);
+ __time64_t t64 = *t;
+ return __gmtime64 (&t64);
}
+
+#endif