summaryrefslogtreecommitdiffstats
path: root/kernel/posix-timers.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 15:12:41 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 15:12:41 -0700
commit58f9b52ee8712283f7ffedb661df678c61e88a91 (patch)
treefe6d2e1bca6befd8ca347487a7c053b8136320ad /kernel/posix-timers.c
parent2af170dd241810212cbdbdc802ba7d39e3fb23b9 (diff)
parentc70878b4e0b6cf8d2f1e46319e48e821ef4a8aba (diff)
Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
* ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt: hrtimer: hook compat_sys_nanosleep up to high res timer code hrtimer: Rework hrtimer_nanosleep to make sys_compat_nanosleep easier
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r--kernel/posix-timers.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index d71ed09fe1d..d11f579d189 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -981,9 +981,20 @@ sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
static int common_nsleep(const clockid_t which_clock, int flags,
struct timespec *tsave, struct timespec __user *rmtp)
{
- return hrtimer_nanosleep(tsave, rmtp, flags & TIMER_ABSTIME ?
- HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
- which_clock);
+ struct timespec rmt;
+ int ret;
+
+ ret = hrtimer_nanosleep(tsave, rmtp ? &rmt : NULL,
+ flags & TIMER_ABSTIME ?
+ HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
+ which_clock);
+
+ if (ret && rmtp) {
+ if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
+ return -EFAULT;
+ }
+
+ return ret;
}
asmlinkage long