[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>
This commit is contained in:
committed by
Linus Torvalds
parent
10c94ec16d
commit
6ba1b91213
@@ -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:
|
||||
*/
|
||||
|
Reference in New Issue
Block a user