diff mbox series

[RFC,09/12] y2038: Convert __xclock_gettime to be Y2038 safe

Message ID 20200601140740.16371-10-lukma@denx.de
State New
Headers show
Series y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe | expand

Commit Message

Lukasz Majewski June 1, 2020, 2:07 p.m. UTC
The clock_gettime has been replaced with Y2038 safe __clock_gettime64.
Morevoer, the struct timespec has been replaced with struct __timespec64.
---
 support/xclock_gettime.c | 4 ++--
 support/xtime.h          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/support/xclock_gettime.c b/support/xclock_gettime.c
index fed397b784..6d32c00847 100644
--- a/support/xclock_gettime.c
+++ b/support/xclock_gettime.c
@@ -21,9 +21,9 @@ 
 #include <support/xthread.h>
 
 void
-__xclock_gettime (clockid_t clockid, struct timespec *ts)
+__xclock_gettime (clockid_t clockid, struct __timespec64 *ts)
 {
-  const int ret = clock_gettime (clockid, ts);
+  const int ret = __clock_gettime64 (clockid, ts);
   if (ret < 0)
     FAIL_EXIT1 ("clock_gettime (%d): %m",
                 clockid);
diff --git a/support/xtime.h b/support/xtime.h
index 0fce19a78d..f04dac14fd 100644
--- a/support/xtime.h
+++ b/support/xtime.h
@@ -27,7 +27,7 @@  __BEGIN_DECLS
 /* The following functions call the corresponding libc functions and
    terminate the process on error.  */
 
-void __xclock_gettime (clockid_t clock, struct timespec *ts);
+void __xclock_gettime (clockid_t clock, struct __timespec64 *ts);
 
 /* This helper can often simplify tests by avoiding an explicit
    variable declaration or allowing that declaration to be const. */