diff options
Diffstat (limited to 'sysdeps/sparc')
-rw-r--r-- | sysdeps/sparc/sparc32/lll_timedlock_wait.c | 2 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/lowlevellock.c | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sysdeps/sparc/sparc32/lll_timedlock_wait.c b/sysdeps/sparc/sparc32/lll_timedlock_wait.c index c2c93faf1b..bd639a7091 100644 --- a/sysdeps/sparc/sparc32/lll_timedlock_wait.c +++ b/sysdeps/sparc/sparc32/lll_timedlock_wait.c @@ -1 +1 @@ -/* __lll_timedlock_wait is in lowlevellock.c. */ +/* __lll_clocklock_wait is in lowlevellock.c. */ diff --git a/sysdeps/sparc/sparc32/lowlevellock.c b/sysdeps/sparc/sparc32/lowlevellock.c index 1a0b7bbe00..b0c5a6ddf6 100644 --- a/sysdeps/sparc/sparc32/lowlevellock.c +++ b/sysdeps/sparc/sparc32/lowlevellock.c @@ -52,7 +52,8 @@ __lll_lock_wait (int *futex, int private) int -__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private) +__lll_clocklock_wait (int *futex, clockid_t clockid, + const struct timespec *abstime, int private) { /* Reject invalid timeouts. */ if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) @@ -60,15 +61,17 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime, int private) do { - struct timeval tv; + struct timespec ts; struct timespec rt; - /* Get the current time. */ - (void) __gettimeofday (&tv, NULL); + /* Get the current time. This can only fail if clockid is not + valid. */ + if (__glibc_unlikely (__clock_gettime (clockid, &ts) != 0)) + return EINVAL; /* Compute relative timeout. */ - rt.tv_sec = abstime->tv_sec - tv.tv_sec; - rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; + rt.tv_sec = abstime->tv_sec - ts.tv_sec; + rt.tv_nsec = abstime->tv_nsec - ts.tv_nsec; if (rt.tv_nsec < 0) { rt.tv_nsec += 1000000000; |