Date: Fri, 22 Jun 2007 21:38:45 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122167 for review Message-ID: <200706222138.l5MLcjxa021194@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706222138.l5MLcjxa021194>