@@ -44,3 +44,38 @@ timespec_get (struct timespec *ts, int base)
return base;
}
+
+/* 64-bit time version */
+
+extern int __y2038_linux_support;
+
+int
+__timespec_get64 (struct __timespec64 *ts, int base)
+{
+ switch (base)
+ {
+ int res;
+ INTERNAL_SYSCALL_DECL (err);
+ case TIME_UTC:
+ if (__y2038_linux_support)
+ {
+ res = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
+ }
+ else
+ {
+ struct timespec ts32;
+ res = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);
+ if (INTERNAL_SYSCALL_ERROR_P (res, err))
+ return 0;
+ ts->tv_sec = ts32.tv_sec;
+ ts->tv_nsec = ts32.tv_nsec;
+ ts->tv_pad = 0;
+ }
+ break;
+
+ default:
+ return 0;
+ }
+
+ return base;
+}
@@ -65,4 +65,11 @@ libc {
GLIBC_2.16 {
timespec_get;
}
+
+ # Y2038 symbols are given their own version until they can be put in
+ # the right place
+
+ GLIBC_Y2038 {
+ __timespec_get64;
+ }
}
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> --- sysdeps/unix/sysv/linux/timespec_get.c | 35 ++++++++++++++++++++++++++++++++++ time/Versions | 7 +++++++ 2 files changed, 42 insertions(+)