diff options
author | Davide Libenzi <davidel@xmailserver.org> | 2007-05-11 01:23:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 11:29:36 -0400 |
commit | 83f5d1266926c75890f1bc4678e49d79483cb573 (patch) | |
tree | ae97719503b7fe3688413655d89772bb8b644312 /fs/compat.c | |
parent | 57ac8898508638ca6d15ecd8b911a431d673ff30 (diff) |
signal/timer/event: timerfd compat code
This patch implements the necessary compat code for the timerfd system call.
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/compat.c b/fs/compat.c index 2487b83b18df..7b21b0a82596 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -2225,3 +2225,26 @@ asmlinkage long compat_sys_signalfd(int ufd, | |||
2225 | 2225 | ||
2226 | #endif /* CONFIG_SIGNALFD */ | 2226 | #endif /* CONFIG_SIGNALFD */ |
2227 | 2227 | ||
2228 | #ifdef CONFIG_TIMERFD | ||
2229 | |||
2230 | asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, | ||
2231 | const struct compat_itimerspec __user *utmr) | ||
2232 | { | ||
2233 | long res; | ||
2234 | struct itimerspec t; | ||
2235 | struct itimerspec __user *ut; | ||
2236 | |||
2237 | res = -EFAULT; | ||
2238 | if (get_compat_itimerspec(&t, utmr)) | ||
2239 | goto err_exit; | ||
2240 | ut = compat_alloc_user_space(sizeof(*ut)); | ||
2241 | if (copy_to_user(ut, &t, sizeof(t)) ) | ||
2242 | goto err_exit; | ||
2243 | |||
2244 | res = sys_timerfd(ufd, clockid, flags, ut); | ||
2245 | err_exit: | ||
2246 | return res; | ||
2247 | } | ||
2248 | |||
2249 | #endif /* CONFIG_TIMERFD */ | ||
2250 | |||