From 6ba1b91213e81aa92b5cf7539f7d2a94ff54947c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 9 Jan 2006 20:52:36 -0800 Subject: [PATCH] hrtimer: switch sys_nanosleep to hrtimer convert sys_nanosleep() to use hrtimer_nanosleep() Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/hrtimer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'kernel/hrtimer.c') 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: */ -- cgit v1.2.3