summaryrefslogtreecommitdiff
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 64d37a3c5948..11fde0caee56 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -707,6 +707,20 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
return -ERESTART_RESTARTBLOCK;
}
+asmlinkage long
+sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
+{
+ struct timespec tu;
+
+ if (copy_from_user(&tu, rqtp, sizeof(tu)))
+ return -EFAULT;
+
+ if (!timespec_valid(&tu))
+ return -EINVAL;
+
+ return hrtimer_nanosleep(&tu, rmtp, HRTIMER_REL, CLOCK_MONOTONIC);
+}
+
/*
* Functions related to boot-time initialization:
*/