diff options
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c')
-rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c b/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c index 73fae44bc..9c7230934 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c @@ -8,11 +8,17 @@ /* Pause execution for a number of nanoseconds. */ int -nanosleep (const struct timespec *requested_time, +_NC(nanosleep) (const struct timespec *requested_time, struct timespec *remaining) { - return _syscall2(int, __NC(nanosleep), const struct timespec*, - requested_time, struct timespec* remaining) + int __ret = clock_nanosleep(CLOCK_REALTIME, 0, requested_time, remaining); + + if (__ret != 0) { + __set_errno(__ret); + return -1; + } + + return __ret; } CANCELLABLE_SYSCALL(int, nanosleep, (const struct timespec *requested_time, |