PERFORCE change 122167 for review
Peter Wemm
peter at FreeBSD.org
Fri Jun 22 21:38:46 UTC 2007
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);
}
More information about the p4-projects
mailing list