PERFORCE change 122167 for review
Alfred Perlstein
alfred at freebsd.org
Mon Jun 25 04:31:52 UTC 2007
er, can't you just do a signal(SIGSYS, SIG_IGN)?
* Peter Wemm <peter at FreeBSD.org> [070622 14:38] wrote:
> http://perforce.freebsd.org/chv.cgi?CH=122167
>
> Change 122167 by peter at 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
More information about the p4-projects
mailing list