diff options
author | Davide Libenzi <davidel@xmailserver.org> | 2007-05-10 22:23:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 08:29:36 -0700 |
commit | 83f5d1266926c75890f1bc4678e49d79483cb573 (patch) | |
tree | ae97719503b7fe3688413655d89772bb8b644312 /fs | |
parent | 57ac8898508638ca6d15ecd8b911a431d673ff30 (diff) | |
download | linux-83f5d1266926c75890f1bc4678e49d79483cb573.tar.bz2 |
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')
-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, #endif /* CONFIG_SIGNALFD */ +#ifdef CONFIG_TIMERFD + +asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, + const struct compat_itimerspec __user *utmr) +{ + long res; + struct itimerspec t; + struct itimerspec __user *ut; + + res = -EFAULT; + if (get_compat_itimerspec(&t, utmr)) + goto err_exit; + ut = compat_alloc_user_space(sizeof(*ut)); + if (copy_to_user(ut, &t, sizeof(t)) ) + goto err_exit; + + res = sys_timerfd(ufd, clockid, flags, ut); +err_exit: + return res; +} + +#endif /* CONFIG_TIMERFD */ + |