[RFC 10/12] y2038: Convert __xclock_now to be Y2038 safe

Lukasz Majewski lukma@denx.de
Mon Jun 1 14:07:38 GMT 2020


The struct timespec has been replaced with Y2038 safe struct __timespec64.

Tested with glibc/glibc-many-build --keep failed glibcs
---
 support/xtime.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/xtime.h b/support/xtime.h
index f04dac14fd..91fac43711 100644
--- a/support/xtime.h
+++ b/support/xtime.h
@@ -32,9 +32,9 @@ 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. */
 
-static inline struct timespec __xclock_now (clockid_t clock)
+static inline struct __timespec64 __xclock_now (clockid_t clock)
 {
-  struct timespec ts;
+  struct __timespec64 ts;
   __xclock_gettime (clock, &ts);
   return ts;
 }
-- 
2.20.1



More information about the Libc-alpha mailing list