Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat SA_SIGINFO changes



details:   https://anonhg.NetBSD.org/src/rev/895858b70660
branches:  trunk
changeset: 551451:895858b70660
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 06 22:09:20 2003 +0000

description:
SA_SIGINFO changes

diffstat:

 sys/compat/common/kern_sig_43.c            |  12 +++++++++---
 sys/compat/darwin/darwin_signal.h          |   6 +++++-
 sys/compat/freebsd/freebsd_exec.c          |   5 +++--
 sys/compat/freebsd/freebsd_signal.h        |   9 ++++++++-
 sys/compat/ibcs2/ibcs2_exec.c              |   5 +++--
 sys/compat/ibcs2/ibcs2_signal.h            |   8 +++++++-
 sys/compat/linux/arch/i386/linux_machdep.c |  15 ++++++---------
 sys/compat/linux/arch/i386/linux_machdep.h |   8 +-------
 sys/compat/linux/common/linux_exec.h       |   6 +++++-
 sys/compat/linux/common/linux_machdep.h    |   6 +++++-
 sys/compat/svr4/svr4_signal.h              |   6 +++++-
 11 files changed, 57 insertions(+), 29 deletions(-)

diffs (276 lines):

diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/common/kern_sig_43.c
--- a/sys/compat/common/kern_sig_43.c   Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/common/kern_sig_43.c   Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig_43.c,v 1.18 2003/01/18 07:28:34 thorpej Exp $ */
+/*     $NetBSD: kern_sig_43.c,v 1.19 2003/09/06 22:09:20 christos Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.18 2003/01/18 07:28:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.19 2003/09/06 22:09:20 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -263,6 +263,7 @@
                syscallarg(int) signum;
        } */ *uap = v;
        struct proc *p = l->l_proc;
+       ksiginfo_t ksi;
 
 #ifdef COMPAT_09
        SCARG(uap, pgid) = (short) SCARG(uap, pgid);
@@ -270,5 +271,10 @@
 
        if ((u_int)SCARG(uap, signum) >= NSIG)
                return (EINVAL);
-       return (killpg1(p, SCARG(uap, signum), SCARG(uap, pgid), 0));
+       memset(&ksi, 0, sizeof(ksi));
+       ksi.ksi_signo = SCARG(uap, signum);
+       ksi.ksi_code = SI_USER;
+       ksi.ksi_pid = p->p_pid;
+       ksi.ksi_uid = p->p_ucred->cr_uid;
+       return (killpg1(p, &ksi, SCARG(uap, pgid), 0));
 }
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/darwin/darwin_signal.h
--- a/sys/compat/darwin/darwin_signal.h Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/darwin/darwin_signal.h Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: darwin_signal.h,v 1.5 2003/02/03 20:46:55 manu Exp $ */
+/*     $NetBSD: darwin_signal.h,v 1.6 2003/09/06 22:09:20 christos Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -79,7 +79,11 @@
        int darwin_sa_flags;
 };
 
+#ifdef __HAVE_SIGINFO
+void darwin_sendsig(ksiginfo_t *, sigset_t *);
+#else
 void darwin_sendsig(int, sigset_t *, u_long);
+#endif
 
 #endif /* _DARWIN_SIGNAL_H_ */
 
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/freebsd/freebsd_exec.c
--- a/sys/compat/freebsd/freebsd_exec.c Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/freebsd/freebsd_exec.c Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: freebsd_exec.c,v 1.20 2003/08/24 17:52:41 chs Exp $    */
+/*     $NetBSD: freebsd_exec.c,v 1.21 2003/09/06 22:09:20 christos Exp $       */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.20 2003/08/24 17:52:41 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.21 2003/09/06 22:09:20 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,6 +40,7 @@
 
 #include <compat/freebsd/freebsd_syscall.h>
 #include <compat/freebsd/freebsd_exec.h>
+#include <compat/freebsd/freebsd_signal.h>
 #include <compat/common/compat_util.h>
 
 extern struct sysent freebsd_sysent[];
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/freebsd/freebsd_signal.h
--- a/sys/compat/freebsd/freebsd_signal.h       Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/freebsd/freebsd_signal.h       Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: freebsd_signal.h,v 1.2 2002/11/26 18:43:20 christos Exp $ */
+/*     $NetBSD: freebsd_signal.h,v 1.3 2003/09/06 22:09:21 christos Exp $ */
 
 /*
  * Copyright (c) 2000 Atsushi Onoe
@@ -40,5 +40,12 @@
        int     freebsd_sa_flags;               /* see signal options below */
        sigset_t freebsd_sa_mask;               /* signal mask to apply */
 };
+#ifdef _KERNEL
+#ifdef __HAVE_SIGINFO
+void freebsd_sendsig(ksiginfo_t *, sigset_t *);
+#else
+void freebsd_sendsig(int, sigset_t *, u_long);
+#endif
+#endif
 
 #endif /* _FREEBSD_SIG_H */
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/ibcs2/ibcs2_exec.c
--- a/sys/compat/ibcs2/ibcs2_exec.c     Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/ibcs2/ibcs2_exec.c     Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_exec.c,v 1.53 2003/08/24 17:52:42 chs Exp $      */
+/*     $NetBSD: ibcs2_exec.c,v 1.54 2003/09/06 22:09:21 christos Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.53 2003/08/24 17:52:42 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.54 2003/09/06 22:09:21 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -51,6 +51,7 @@
 
 #include <compat/ibcs2/ibcs2_types.h>
 #include <compat/ibcs2/ibcs2_exec.h>
+#include <compat/ibcs2/ibcs2_signal.h>
 #include <compat/ibcs2/ibcs2_errno.h>
 #include <compat/ibcs2/ibcs2_syscall.h>
 
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/ibcs2/ibcs2_signal.h
--- a/sys/compat/ibcs2/ibcs2_signal.h   Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/ibcs2/ibcs2_signal.h   Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_signal.h,v 1.12 2002/11/26 18:43:20 christos Exp $       */
+/*     $NetBSD: ibcs2_signal.h,v 1.13 2003/09/06 22:09:21 christos Exp $       */
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -125,4 +125,10 @@
 void ibcs2_to_native_sigset __P((const ibcs2_sigset_t *, sigset_t *));
 void native_to_ibcs2_sigset __P((const sigset_t *, ibcs2_sigset_t *));
 
+#ifdef __HAVE_SIGINFO
+void   ibcs2_sendsig __P((struct ksiginfo *, sigset_t *));
+#else
+void   ibcs2_sendsig __P((int, sigset_t *, u_long));
+#endif
+
 #endif /* _IBCS2_SIGNAL_H */
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/linux/arch/i386/linux_machdep.c
--- a/sys/compat/linux/arch/i386/linux_machdep.c        Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/linux/arch/i386/linux_machdep.c        Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.c,v 1.95 2003/08/24 17:52:43 chs Exp $   */
+/*     $NetBSD: linux_machdep.c,v 1.96 2003/09/06 22:09:21 christos Exp $      */
 
 /*-
  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.95 2003/08/24 17:52:43 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.96 2003/09/06 22:09:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vm86.h"
@@ -192,15 +192,12 @@
  */
 
 void
-linux_sendsig(sig, mask, code)
-       int sig;
-       sigset_t *mask;
-       u_long code;
+linux_sendsig(ksiginfo_t *ksi, sigset_t *mask)
 {
-       if (SIGACTION(curproc, sig).sa_flags & SA_SIGINFO)
-               linux_rt_sendsig(sig, mask, code);
+       if (SIGACTION(curproc, ksi->ksi_signo).sa_flags & SA_SIGINFO)
+               linux_rt_sendsig(ksi->ksi_signo, mask, ksi->ksi_trap);
        else
-               linux_old_sendsig(sig, mask, code);
+               linux_old_sendsig(ksi->ksi_signo, mask, ksi->ksi_trap);
 }
 
 
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/linux/arch/i386/linux_machdep.h
--- a/sys/compat/linux/arch/i386/linux_machdep.h        Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/linux/arch/i386/linux_machdep.h        Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.h,v 1.26 2003/07/03 21:24:28 christos Exp $      */
+/*     $NetBSD: linux_machdep.h,v 1.27 2003/09/06 22:09:21 christos Exp $      */
 
 /*-
  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -154,12 +154,6 @@
        sig_t   sf_handler;
 };
 
-#ifdef _KERNEL
-__BEGIN_DECLS
-void linux_sendsig __P((int, sigset_t *, u_long));
-__END_DECLS
-#endif /* _KERNEL */
-
 /*
  * Major device numbers of VT device on both Linux and NetBSD. Used in
  * ugly patch to fake device numbers.
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/linux/common/linux_exec.h
--- a/sys/compat/linux/common/linux_exec.h      Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/linux/common/linux_exec.h      Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec.h,v 1.29 2003/06/29 22:29:27 fvdl Exp $     */
+/*     $NetBSD: linux_exec.h,v 1.30 2003/09/06 22:09:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -126,7 +126,11 @@
 int exec_linux_aout_makecmds __P((struct proc *, struct exec_package *));
 int linux_aout_copyargs __P((struct proc *, struct exec_package *,
     struct ps_strings *, char **, void *));
+#ifdef __HAVE_SIGINFO
+void linux_trapsignal __P((struct lwp *, ksiginfo_t *));
+#else
 void linux_trapsignal __P((struct lwp *, int, u_long));
+#endif
 
 #ifdef EXEC_ELF32
 int linux_elf32_probe __P((struct proc *, struct exec_package *, void *,
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/linux/common/linux_machdep.h
--- a/sys/compat/linux/common/linux_machdep.h   Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/linux/common/linux_machdep.h   Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.h,v 1.7 2002/07/04 23:32:11 thorpej Exp $        */
+/*     $NetBSD: linux_machdep.h,v 1.8 2003/09/06 22:09:22 christos Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -57,7 +57,11 @@
 
 #ifdef _KERNEL
 __BEGIN_DECLS
+#ifdef __HAVE_SIGINFO
+void linux_sendsig __P((ksiginfo_t *, sigset_t *));
+#else
 void linux_sendsig __P((int, sigset_t *, u_long));
+#endif
 dev_t linux_fakedev __P((dev_t, int));
 __END_DECLS
 #endif /* !_KERNEL */
diff -r 6ff9cfbbd045 -r 895858b70660 sys/compat/svr4/svr4_signal.h
--- a/sys/compat/svr4/svr4_signal.h     Sat Sep 06 22:08:48 2003 +0000
+++ b/sys/compat/svr4/svr4_signal.h     Sat Sep 06 22:09:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_signal.h,v 1.24 2003/01/18 08:44:27 thorpej Exp $  */
+/*     $NetBSD: svr4_signal.h,v 1.25 2003/09/06 22:09:22 christos Exp $         */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -139,7 +139,11 @@
 void svr4_to_native_sigset __P((const svr4_sigset_t *, sigset_t *));
 void native_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *));
 void svr4_to_native_sigaltstack __P((const struct svr4_sigaltstack *, struct sigaltstack *));
+#ifdef __HAVE_SIGINFO
+void svr4_sendsig __P((struct ksiginfo *, sigset_t *));
+#else
 void svr4_sendsig __P((int, sigset_t *, u_long));
+#endif
 
 /* sys_context() function codes */
 #define        SVR4_GETCONTEXT         0



Home | Main Index | Thread Index | Old Index