diff options
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 64d37a3c594..11fde0caee5 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: */ |