[RFC 08/12] y2038: Convert __make_timespec to be Y2038 safe

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


The conversion was to use Y2038 safe struct __timespec64 and __time64_t.
---
 support/timespec.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/support/timespec.h b/support/timespec.h
index 936d0b0d84..8de40d25f4 100644
--- a/support/timespec.h
+++ b/support/timespec.h
@@ -29,10 +29,10 @@ struct timespec __timespec_add (struct timespec, struct timespec)
 struct timespec __timespec_sub (struct timespec, struct timespec)
   __attribute__((const));
 
-static inline struct timespec
-__make_timespec (time_t s, long int ns)
+static inline struct __timespec64
+__make_timespec (__time64_t s, long int ns)
 {
-  struct timespec r;
+  struct __timespec64 r;
   r.tv_sec = s;
   r.tv_nsec = ns;
   return r;
-- 
2.20.1



More information about the Libc-alpha mailing list