aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2007-05-11 01:23:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 11:29:36 -0400
commit6d18c9220965b437287c3a7e803725c24992ceac (patch)
tree95b87523f134f10a25487b6fdc702a338fb0e911
parent2121e24bd8dd16b4e3f8d995428e2a748d5180cc (diff)
signal/timer/event: signalfd compat code
This patch implements the necessary compat code for the signalfd 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>
-rw-r--r--fs/compat.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/compat.c b/fs/compat.c
index 9cf75df9b2bb..2487b83b18df 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -46,6 +46,7 @@
46#include <linux/tsacct_kern.h> 46#include <linux/tsacct_kern.h>
47#include <linux/security.h> 47#include <linux/security.h>
48#include <linux/highmem.h> 48#include <linux/highmem.h>
49#include <linux/signal.h>
49#include <linux/poll.h> 50#include <linux/poll.h>
50#include <linux/mm.h> 51#include <linux/mm.h>
51#include <linux/eventpoll.h> 52#include <linux/eventpoll.h>
@@ -2199,3 +2200,28 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
2199#endif /* TIF_RESTORE_SIGMASK */ 2200#endif /* TIF_RESTORE_SIGMASK */
2200 2201
2201#endif /* CONFIG_EPOLL */ 2202#endif /* CONFIG_EPOLL */
2203
2204#ifdef CONFIG_SIGNALFD
2205
2206asmlinkage long compat_sys_signalfd(int ufd,
2207 const compat_sigset_t __user *sigmask,
2208 compat_size_t sigsetsize)
2209{
2210 compat_sigset_t ss32;
2211 sigset_t tmp;
2212 sigset_t __user *ksigmask;
2213
2214 if (sigsetsize != sizeof(compat_sigset_t))
2215 return -EINVAL;
2216 if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
2217 return -EFAULT;
2218 sigset_from_compat(&tmp, &ss32);
2219 ksigmask = compat_alloc_user_space(sizeof(sigset_t));
2220 if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
2221 return -EFAULT;
2222
2223 return sys_signalfd(ufd, ksigmask, sizeof(sigset_t));
2224}
2225
2226#endif /* CONFIG_SIGNALFD */
2227