[[PATCH,RFC,2] 27/63] Y2038: add function __timer_gettime64
Commit Message
For Linux this uses the 32-bit time syscall, so it
converts the syscall output into 64-bit time.
---
rt/Versions | 3 +++
sysdeps/unix/sysv/linux/arm/librt.abilist | 2 ++
.../sysv/linux/powerpc/powerpc32/librt.abilist | 2 ++
sysdeps/unix/sysv/linux/timer_gettime.c | 22 ++++++++++++++++++++++
4 files changed, 29 insertions(+)
@@ -37,4 +37,7 @@ librt {
GLIBC_2.7 {
__mq_open_2;
}
+ GLIBC_2.27 {
+ __timer_gettime64;
+ }
}
@@ -1,3 +1,5 @@
+GLIBC_2.27 GLIBC_2.27 A
+GLIBC_2.27 __timer_gettime64 F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 aio_cancel F
GLIBC_2.4 aio_cancel64 F
@@ -29,6 +29,8 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
+GLIBC_2.27 GLIBC_2.27 A
+GLIBC_2.27 __timer_gettime64 F
GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
@@ -39,3 +39,25 @@ timer_gettime (timer_t timerid, struct itimerspec *value)
return res;
}
+
+/* 64-bit time version */
+
+int
+__timer_gettime64 (timer_t timerid, struct __itimerspec64 *value)
+{
+ struct itimerspec value32;
+ struct timer *kt = (struct timer *) timerid;
+ int res;
+
+ res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, &value32);
+
+ if (res == 0)
+ {
+ value->it_value.tv_sec = value32.it_value.tv_sec;
+ value->it_value.tv_nsec = value32.it_value.tv_nsec;
+ value->it_interval.tv_sec = value32.it_interval.tv_sec;
+ value->it_interval.tv_nsec = value32.it_interval.tv_nsec;
+ }
+
+ return res;
+}