Source-Changes-HG archive

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

[src/trunk]: src/sys Add a sigfilter emulation hook. It is used at the beginn...



details:   https://anonhg.NetBSD.org/src/rev/30016a9857af
branches:  trunk
changeset: 555890:30016a9857af
user:      manu <manu%NetBSD.org@localhost>
date:      Wed Dec 03 20:24:51 2003 +0000

description:
Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)

diffstat:

 sys/compat/aout/aout_exec.c           |   5 +++--
 sys/compat/aoutm68k/aoutm68k_exec.c   |   5 +++--
 sys/compat/darwin/darwin_exec.c       |   5 +++--
 sys/compat/freebsd/freebsd_exec.c     |   5 +++--
 sys/compat/hpux/hpux_exec.c           |   5 +++--
 sys/compat/ibcs2/ibcs2_exec.c         |   5 +++--
 sys/compat/irix/irix_exec.c           |   5 +++--
 sys/compat/linux/common/linux_exec.c  |   5 +++--
 sys/compat/mach/mach_exec.c           |   5 +++--
 sys/compat/netbsd32/netbsd32_netbsd.c |   5 +++--
 sys/compat/osf1/osf1_exec.c           |   5 +++--
 sys/compat/pecoff/pecoff_emul.c       |   5 +++--
 sys/compat/sunos/sunos_exec.c         |   5 +++--
 sys/compat/sunos32/sunos32_exec.c     |   5 +++--
 sys/compat/svr4/svr4_exec.c           |   5 +++--
 sys/compat/svr4_32/svr4_32_exec.c     |   5 +++--
 sys/compat/ultrix/ultrix_misc.c       |   5 +++--
 sys/kern/kern_exec.c                  |   5 +++--
 sys/kern/kern_sig.c                   |  10 ++++++++--
 sys/sys/proc.h                        |   5 ++++-
 20 files changed, 66 insertions(+), 39 deletions(-)

diffs (truncated from 521 to 300 lines):

diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/aout/aout_exec.c
--- a/sys/compat/aout/aout_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/aout/aout_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aout_exec.c,v 1.17 2003/09/23 14:33:34 christos Exp $  */
+/*     $NetBSD: aout_exec.c,v 1.18 2003/12/03 20:24:51 manu Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aout_exec.c,v 1.17 2003/09/23 14:33:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aout_exec.c,v 1.18 2003/12/03 20:24:51 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
@@ -84,6 +84,7 @@
 #endif
        sendsig,
        trapsignal,
+       NULL,
 #ifdef COMPAT_16
        sigcode,
        esigcode,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/aoutm68k/aoutm68k_exec.c
--- a/sys/compat/aoutm68k/aoutm68k_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/aoutm68k/aoutm68k_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aoutm68k_exec.c,v 1.13 2003/08/24 17:52:40 chs Exp $   */
+/*     $NetBSD: aoutm68k_exec.c,v 1.14 2003/12/03 20:24:51 manu Exp $  */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.13 2003/08/24 17:52:40 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.14 2003/12/03 20:24:51 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
@@ -78,6 +78,7 @@
 #endif
        sendsig,
        trapsignal,
+       NULL,
        sigcode,
        esigcode,
        &emul_netbsd_aoutm68k_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/darwin/darwin_exec.c
--- a/sys/compat/darwin/darwin_exec.c   Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/darwin/darwin_exec.c   Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: darwin_exec.c,v 1.25 2003/11/20 22:05:25 manu Exp $ */
+/*     $NetBSD: darwin_exec.c,v 1.26 2003/12/03 20:24:51 manu Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include "opt_compat_darwin.h" /* For COMPAT_DARWIN in mach_port.h */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_exec.c,v 1.25 2003/11/20 22:05:25 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_exec.c,v 1.26 2003/12/03 20:24:51 manu Exp $");
 
 #include "opt_syscall_debug.h"
 
@@ -111,6 +111,7 @@
 #endif
        darwin_sendsig,
        darwin_trapsignal,
+       darwin_sigfilter,
 #if !defined(__HAVE_SIGINFO) || defined(COMPAT_16)
        sigcode,
        esigcode,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/freebsd/freebsd_exec.c
--- a/sys/compat/freebsd/freebsd_exec.c Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/freebsd/freebsd_exec.c Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: freebsd_exec.c,v 1.21 2003/09/06 22:09:20 christos Exp $       */
+/*     $NetBSD: freebsd_exec.c,v 1.22 2003/12/03 20:24:51 manu 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.21 2003/09/06 22:09:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.22 2003/12/03 20:24:51 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,6 +66,7 @@
        freebsd_syscallnames,
        freebsd_sendsig,
        trapsignal,
+       NULL,
        freebsd_sigcode,
        freebsd_esigcode,
        &emul_freebsd_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/hpux/hpux_exec.c
--- a/sys/compat/hpux/hpux_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/hpux/hpux_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpux_exec.c,v 1.38 2003/08/24 17:52:41 chs Exp $       */
+/*     $NetBSD: hpux_exec.c,v 1.39 2003/12/03 20:24:51 manu Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.38 2003/08/24 17:52:41 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.39 2003/12/03 20:24:51 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -123,6 +123,7 @@
        hpux_syscallnames,
        hpux_sendsig,
        trapsignal,
+       NULL,
        sigcode,
        esigcode,
        &emul_hpux_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/ibcs2/ibcs2_exec.c
--- a/sys/compat/ibcs2/ibcs2_exec.c     Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/ibcs2/ibcs2_exec.c     Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_exec.c,v 1.54 2003/09/06 22:09:21 christos Exp $ */
+/*     $NetBSD: ibcs2_exec.c,v 1.55 2003/12/03 20:24:51 manu 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.54 2003/09/06 22:09:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.55 2003/12/03 20:24:51 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -83,6 +83,7 @@
        ibcs2_syscallnames,
        ibcs2_sendsig,
        trapsignal,
+       NULL,
        ibcs2_sigcode,
        ibcs2_esigcode,
        &emul_ibcs2_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/irix/irix_exec.c
--- a/sys/compat/irix/irix_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/irix/irix_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_exec.c,v 1.32 2003/11/26 08:36:51 he Exp $ */
+/*     $NetBSD: irix_exec.c,v 1.33 2003/12/03 20:24:51 manu Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.32 2003/11/26 08:36:51 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.33 2003/12/03 20:24:51 manu Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_syscall_debug.h"
@@ -104,6 +104,7 @@
 #endif
        irix_sendsig,
        trapsignal,
+       NULL,
        irix_sigcode,
        irix_sigcode,
        NULL,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/linux/common/linux_exec.c
--- a/sys/compat/linux/common/linux_exec.c      Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/linux/common/linux_exec.c      Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec.c,v 1.65 2003/08/24 17:52:43 chs Exp $      */
+/*     $NetBSD: linux_exec.c,v 1.66 2003/12/03 20:24:51 manu Exp $     */
 
 /*-
  * Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.65 2003/08/24 17:52:43 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.66 2003/12/03 20:24:51 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -127,6 +127,7 @@
        linux_syscallnames,
        linux_sendsig,
        linux_trapsignal,
+       NULL,
        linux_sigcode,
        linux_esigcode,
        &emul_linux_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/mach/mach_exec.c
--- a/sys/compat/mach/mach_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/mach/mach_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_exec.c,v 1.40 2003/11/25 13:22:38 manu Exp $       */
+/*     $NetBSD: mach_exec.c,v 1.41 2003/12/03 20:24:51 manu Exp $       */
 
 /*-
  * Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.40 2003/11/25 13:22:38 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.41 2003/12/03 20:24:51 manu Exp $");
 
 #include "opt_syscall_debug.h"
 
@@ -96,6 +96,7 @@
 #endif
        sendsig,
        mach_trapsignal,
+       NULL,
 #if !defined(__HAVE_SIGINFO) || defined(COMPAT_16)
        sigcode,
        esigcode,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c     Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c     Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_netbsd.c,v 1.75 2003/09/26 21:28:24 christos Exp $    */
+/*     $NetBSD: netbsd32_netbsd.c,v 1.76 2003/12/03 20:24:51 manu Exp $        */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.75 2003/09/26 21:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.76 2003/12/03 20:24:51 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -127,6 +127,7 @@
 #endif
        netbsd32_sendsig,
        trapsignal,
+       NULL,
        netbsd32_sigcode,
        netbsd32_esigcode,
        &emul_netbsd32_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/osf1/osf1_exec.c
--- a/sys/compat/osf1/osf1_exec.c       Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/osf1/osf1_exec.c       Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_exec.c,v 1.32 2003/08/24 17:52:44 chs Exp $ */
+/* $NetBSD: osf1_exec.c,v 1.33 2003/12/03 20:24:52 manu Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: osf1_exec.c,v 1.32 2003/08/24 17:52:44 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_exec.c,v 1.33 2003/12/03 20:24:52 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,6 +67,7 @@
        osf1_syscallnames,
        sendsig,
        trapsignal,
+       NULL,
        osf1_sigcode,
        osf1_esigcode,
        &emul_osf1_object,
diff -r c5a4d90d9dfe -r 30016a9857af sys/compat/pecoff/pecoff_emul.c
--- a/sys/compat/pecoff/pecoff_emul.c   Wed Dec 03 20:23:41 2003 +0000
+++ b/sys/compat/pecoff/pecoff_emul.c   Wed Dec 03 20:24:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pecoff_emul.c,v 1.6 2003/08/24 17:52:45 chs Exp $      */
+/*     $NetBSD: pecoff_emul.c,v 1.7 2003/12/03 20:24:52 manu Exp $     */
 
 /*
  * Copyright (c) 2000 Masaru OKI
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.6 2003/08/24 17:52:45 chs Exp $");



Home | Main Index | Thread Index | Old Index