summaryrefslogtreecommitdiff
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-10 07:52:36 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 19:01:38 +0300
commit6ba1b91213e81aa92b5cf7539f7d2a94ff54947c (patch)
tree0d461bf7c7f444a80d09f09501e9fb378a78220f /kernel/hrtimer.c
parent10c94ec16dd187f8d8dfdbb088e98330c05bf03c (diff)
downloadlinux-6ba1b91213e81aa92b5cf7539f7d2a94ff54947c.tar.xz
[PATCH] hrtimer: switch sys_nanosleep to hrtimer
convert sys_nanosleep() to use hrtimer_nanosleep() Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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:
*/