about summary refs log tree commit diff
path: root/src/thread/thrd_sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/thrd_sleep.c')
-rw-r--r--src/thread/thrd_sleep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/thrd_sleep.c b/src/thread/thrd_sleep.c
index e8dfe400..97de5345 100644
--- a/src/thread/thrd_sleep.c
+++ b/src/thread/thrd_sleep.c
@@ -1,10 +1,11 @@
 #include <threads.h>
+#include <time.h>
 #include <errno.h>
 #include "syscall.h"
 
 int thrd_sleep(const struct timespec *req, struct timespec *rem)
 {
-	int ret = __syscall(SYS_nanosleep, req, rem);
+	int ret = -__clock_nanosleep(CLOCK_REALTIME, 0, req, rem);
 	switch (ret) {
 	case 0:      return 0;
 	case -EINTR: return -1; /* value specified by C11 */