summary refs log tree commit diff
path: root/time
diff options
context:
space:
mode:
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-11-20 23:57:23 +0100
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-12-17 22:56:15 +0100
commit6e15f3e26bd180d0d5fd3bc923d5a8489aa698d1 (patch)
treea275aaceafc97f5f16c1621ceaa2f7a0df2aa4c0 /time
parent551e81d9e321ebe63465be2607fd251da38b4b0b (diff)
downloadglibc-6e15f3e26bd180d0d5fd3bc923d5a8489aa698d1.tar.gz
glibc-6e15f3e26bd180d0d5fd3bc923d5a8489aa698d1.tar.xz
glibc-6e15f3e26bd180d0d5fd3bc923d5a8489aa698d1.zip
Y2038: add function __localtime64
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__localtime64): Add.
	* manual/maint.texi: Document Y2038 symbol handling.
	* time/localtime.c
	(__localtime64): Add.
	[__TIMERSIZE != 64] (__localtime): Turn into a wrapper.
Diffstat (limited to 'time')
-rw-r--r--time/localtime.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/time/localtime.c b/time/localtime.c
index 92dbfe0f8c..96879d4ec0 100644
--- a/time/localtime.c
+++ b/time/localtime.c
@@ -34,8 +34,22 @@ weak_alias (__localtime_r, localtime_r)
 
 /* Return the `struct tm' representation of *T in local time.  */
 struct tm *
-localtime (const time_t *t)
+__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)
+{
+  __time64_t t64 = *t;
+  return __localtime64 (&t64);
+}
 libc_hidden_def (localtime)
+
+#endif