[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703071716040.3672@alien.or.mcafeemobile.com>
Date: Wed, 7 Mar 2007 17:22:21 -0800 (PST)
From: Davide Libenzi <davidel@...ilserver.org>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [patch 5/5] signalfd v2 - compat code ...
This patch implement the necessary compat code for the signalfd system calls.
Signed-off-by: Davide Libenzi <davidel@...ilserver.org>
- Davide
Index: linux-2.6.20.ep2/fs/compat.c
===================================================================
--- linux-2.6.20.ep2.orig/fs/compat.c 2007-03-07 13:28:39.000000000 -0800
+++ linux-2.6.20.ep2/fs/compat.c 2007-03-07 13:42:18.000000000 -0800
@@ -46,6 +46,7 @@
#include <linux/rwsem.h>
#include <linux/tsacct_kern.h>
#include <linux/highmem.h>
+#include <linux/signal.h>
#include <linux/poll.h>
#include <linux/mm.h>
@@ -2235,3 +2236,41 @@
return sys_ni_syscall();
}
#endif
+
+asmlinkage long compat_sys_signalfd(int ufd,
+ const compat_sigset_t __user *sigmask,
+ compat_size_t sigsetsize)
+{
+ compat_sigset_t ss32;
+ sigset_t tmp;
+ sigset_t __user *ksigmask;
+
+ if (sigsetsize != sizeof(compat_sigset_t))
+ return -EINVAL;
+ if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
+ return -EFAULT;
+ sigset_from_compat(&tmp, &ss32);
+ ksigmask = compat_alloc_user_space(sizeof(sigset_t));
+ if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
+ return -EFAULT;
+
+ return sys_signalfd(ufd, ksigmask, sizeof(sigset_t));
+}
+
+asmlinkage long compat_sys_signalfd_dequeue(int fd,
+ struct compat_siginfo __user *info,
+ long timeo)
+{
+ siginfo_t kinfo;
+ long ret;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs(KERNEL_DS);
+ ret = sys_signalfd_dequeue(fd, (siginfo_t __user *) &kinfo, timeo);
+ set_fs(old_fs);
+ if (!ret)
+ ret = copy_siginfo_to_user32(info, &kinfo);
+
+ return ret;
+}
+
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists