Date: Sun, 24 Jun 2007 20:58:50 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Peter Wemm <peter@FreeBSD.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 122167 for review Message-ID: <20070625035850.GI55189@elvis.mu.org> In-Reply-To: <200706222138.l5MLcjxa021194@repoman.freebsd.org> References: <200706222138.l5MLcjxa021194@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
er, can't you just do a signal(SIGSYS, SIG_IGN)? * Peter Wemm <peter@FreeBSD.org> [070622 14:38] wrote: > http://perforce.freebsd.org/chv.cgi?CH=122167 > > Change 122167 by peter@peter_daintree on 2007/06/22 21:38:41 > > Add kern.do_sigsys to control whether an enosys() also causes SIGSYS. This would > have been very useful to probe for presence of syscalls. Avoids the need to install > a sigsys handler. If only this was present for the last 10 years.... > > Affected files ... > > .. //depot/projects/hammer/sys/kern/kern_sig.c#80 edit > > Differences ... > > ==== //depot/projects/hammer/sys/kern/kern_sig.c#80 (text+ko) ==== > > @@ -111,6 +111,10 @@ > SYSCTL_INT(_kern, OID_AUTO, forcesigexit, CTLFLAG_RW, > &kern_forcesigexit, 0, "Force trap signal to be handled"); > > +static int kern_do_sigsys = 1; > +SYSCTL_INT(_kern, OID_AUTO, do_sigsys, CTLFLAG_RW, > + &kern_do_sigsys, 0, "Have the kernel send SIGSYS on a bad syscall"); > + > SYSCTL_NODE(_kern, OID_AUTO, sigqueue, CTLFLAG_RW, 0, "POSIX real time signal"); > > static int max_pending_per_proc = 128; > @@ -3168,9 +3172,11 @@ > { > struct proc *p = td->td_proc; > > - PROC_LOCK(p); > - psignal(p, SIGSYS); > - PROC_UNLOCK(p); > + if (kern_do_sigsys) { > + PROC_LOCK(p); > + psignal(p, SIGSYS); > + PROC_UNLOCK(p); > + } > return (ENOSYS); > } > -- - Alfred Perlstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070625035850.GI55189>