getservbyport_r: fix wrong result if getnameinfo fails with EAI_OVERFLOW
[musl] / src / time / nanosleep.c
index 5ac4c35..bc9f789 100644 (file)
@@ -1,13 +1,7 @@
-#include <unistd.h>
 #include <time.h>
 #include "syscall.h"
-#include "libc.h"
 
 int nanosleep(const struct timespec *req, struct timespec *rem)
 {
-       int ret;
-       CANCELPT_BEGIN;
-       ret = syscall2(__NR_nanosleep, (long)req, (long)rem);
-       CANCELPT_END;
-       return ret;
+       return __syscall_ret(-__clock_nanosleep(CLOCK_REALTIME, 0, req, rem));
 }