summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-12-24 21:43:56 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-03 15:09:18 -0500
commitad4b65a434bdd2ff37d095ab1ccd836203e985ba (patch)
tree8e5582b9fe0e867b6ab8d317976b93d864f0bde1 /kernel/signal.c
parenteaca6eae3e0c41d41fcb9d1d70e00934988dff2e (diff)
downloadlinux-ad4b65a434bdd2ff37d095ab1ccd836203e985ba.tar.bz2
consolidate rt_sigsuspend()
* pull compat version alongside with the native one * make little-endian compat variant just call the native * don't bother with separate conditional for compat (both native and compat are going to become unconditional very soon). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 00cd1ce998be..4a0934e03d5c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3352,7 +3352,29 @@ SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize)
return -EFAULT;
return sigsuspend(&newset);
}
-#endif /* __ARCH_WANT_SYS_RT_SIGSUSPEND */
+
+#ifdef CONFIG_COMPAT
+COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_size_t, sigsetsize)
+{
+#ifdef __BIG_ENDIAN
+ sigset_t newset;
+ compat_sigset_t newset32;
+
+ /* XXX: Don't preclude handling different sized sigset_t's. */
+ if (sigsetsize != sizeof(sigset_t))
+ return -EINVAL;
+
+ if (copy_from_user(&newset32, unewset, sizeof(compat_sigset_t)))
+ return -EFAULT;
+ sigset_from_compat(&newset, &newset32);
+ return sigsuspend(&newset);
+#else
+ /* on little-endian bitmaps don't care about granularity */
+ return sys_rt_sigsuspend((sigset_t __user *)unewset, sigsetsize);
+#endif
+}
+#endif
+#endif
__attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma)
{