about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/nanosleep.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/posix/nanosleep.c b/posix/nanosleep.c
index d8564c7119..ed41c8cce7 100644
--- a/posix/nanosleep.c
+++ b/posix/nanosleep.c
@@ -24,10 +24,13 @@ int
 __nanosleep (const struct timespec *requested_time,
 	     struct timespec *remaining)
 {
-  __set_errno (ENOSYS);
-  return -1;
+  int ret = __clock_nanosleep (CLOCK_REALTIME, 0, requested_time, remaining);
+  if (ret != 0)
+    {
+      __set_errno (ret);
+      return -1;
+    }
+  return 0;
 }
-stub_warning (nanosleep)
-
-hidden_def (__nanosleep)
+libc_hidden_def (__nanosleep)
 weak_alias (__nanosleep, nanosleep)