old sigsuspend variants in kernel/signal.c
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 25 Dec 2012 21:04:12 +0000 (16:04 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Feb 2013 20:09:20 +0000 (15:09 -0500)
conditional on OLD_SIGSUSPEND/OLD_SIGSUSPEND3, depending on which
variety of that fossil is needed.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/Kconfig
include/linux/syscalls.h
kernel/signal.c

index c612b5c..6b1df95 100644 (file)
@@ -387,4 +387,14 @@ config ODD_RT_SIGACTION
        help
          Architecture has unusual rt_sigaction(2) arguments
 
+config OLD_SIGSUSPEND
+       bool
+       help
+         Architecture has old sigsuspend(2) syscall, of one-argument variety
+
+config OLD_SIGSUSPEND3
+       bool
+       help
+         Even weirder antique ABI - three-argument sigsuspend(2)
+
 source "kernel/gcov/Kconfig"
index 75defcd..d2dd2f6 100644 (file)
@@ -377,6 +377,14 @@ asmlinkage long sys_init_module(void __user *umod, unsigned long len,
 asmlinkage long sys_delete_module(const char __user *name_user,
                                unsigned int flags);
 
+#ifdef CONFIG_OLD_SIGSUSPEND
+asmlinkage long sys_sigsuspend(old_sigset_t mask);
+#endif
+
+#ifdef CONFIG_OLD_SIGSUSPEND3
+asmlinkage long sys_sigsuspend(int unused1, int unused2, old_sigset_t mask);
+#endif
+
 #ifndef CONFIG_ODD_RT_SIGACTION
 asmlinkage long sys_rt_sigaction(int,
                                 const struct sigaction __user *,
index 6cd3023..93fd4b8 100644 (file)
@@ -3454,6 +3454,23 @@ COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_
 #endif
 #endif
 
+#ifdef CONFIG_OLD_SIGSUSPEND
+SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
+{
+       sigset_t blocked;
+       siginitset(&blocked, mask);
+       return sigsuspend(&blocked);
+}
+#endif
+#ifdef CONFIG_OLD_SIGSUSPEND3
+SYSCALL_DEFINE3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
+{
+       sigset_t blocked;
+       siginitset(&blocked, mask);
+       return sigsuspend(&blocked);
+}
+#endif
+
 __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma)
 {
        return NULL;