[RFC 07/10] y2038: Convert __lll_clocklock_wait function to support 64 bit time

Lukasz Majewski lukma@denx.de
Tue Jul 7 15:08:24 GMT 2020


Prepare the internal __lll_clocklock_wait function to support 64 bit time
on architectures, with __TIMESIZE != 64 and __WORDSIZE == 32
by replacing struct timespec with struct __timespec64 and __clock_gettime
with __clock_gettime64.
---
 nptl/lll_timedlock_wait.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nptl/lll_timedlock_wait.c b/nptl/lll_timedlock_wait.c
index eabdca70c8..82cd76e557 100644
--- a/nptl/lll_timedlock_wait.c
+++ b/nptl/lll_timedlock_wait.c
@@ -26,9 +26,9 @@
 
 int
 __lll_clocklock_wait (int *futex, int val, clockid_t clockid,
-		      const struct timespec *abstime, int private)
+		      const struct __timespec64 *abstime, int private)
 {
-  struct timespec ts, *tsp = NULL;
+  struct __timespec64 ts, *tsp = NULL;
 
   if (abstime != NULL)
     {
@@ -37,7 +37,7 @@ __lll_clocklock_wait (int *futex, int val, clockid_t clockid,
         return EINVAL;
 
       /* Get the current time. This can only fail if clockid is not valid.  */
-      if (__glibc_unlikely (__clock_gettime (clockid, &ts) != 0))
+      if (__glibc_unlikely (__clock_gettime64 (clockid, &ts) != 0))
         return EINVAL;
 
       /* Compute relative timeout.  */
-- 
2.20.1



More information about the Libc-alpha mailing list