about summary refs log tree commit diff
path: root/src/time
diff options
context:
space:
mode:
Diffstat (limited to 'src/time')
-rw-r--r--src/time/clock_nanosleep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c
index ec87b9e3..9e4d9f1f 100644
--- a/src/time/clock_nanosleep.c
+++ b/src/time/clock_nanosleep.c
@@ -1,8 +1,10 @@
 #include <time.h>
+#include <errno.h>
 #include "syscall.h"
 #include "libc.h"
 
 int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem)
 {
-	return -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem);
+	int r = -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem);
+	return clk == CLOCK_THREAD_CPUTIME_ID ? EINVAL : r;
 }