Author: mjg
Date: Mon May  7 23:10:12 2018
New Revision: 333342
URL: https://svnweb.freebsd.org/changeset/base/333342

Log:
  Change trap_enotcap to bool and annotate with __read_frequently
  
  It is read on each return to user space.

Modified:
  head/sys/kern/sys_capability.c
  head/sys/sys/capsicum.h

Modified: head/sys/kern/sys_capability.c
==============================================================================
--- head/sys/kern/sys_capability.c      Mon May  7 23:10:02 2018        
(r333341)
+++ head/sys/kern/sys_capability.c      Mon May  7 23:10:12 2018        
(r333342)
@@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$");
 #include <vm/uma.h>
 #include <vm/vm.h>
 
-int trap_enotcap;
-SYSCTL_INT(_kern, OID_AUTO, trap_enotcap, CTLFLAG_RW, &trap_enotcap, 0,
+bool __read_frequently trap_enotcap;
+SYSCTL_BOOL(_kern, OID_AUTO, trap_enotcap, CTLFLAG_RW, &trap_enotcap, 0,
     "Deliver SIGTRAP on ENOTCAPABLE");
 
 #ifdef CAPABILITY_MODE

Modified: head/sys/sys/capsicum.h
==============================================================================
--- head/sys/sys/capsicum.h     Mon May  7 23:10:02 2018        (r333341)
+++ head/sys/sys/capsicum.h     Mon May  7 23:10:12 2018        (r333342)
@@ -370,7 +370,7 @@ int cap_ioctl_check(struct filedesc *fdp, int fd, u_lo
 int    cap_fcntl_check_fde(struct filedescent *fde, int cmd);
 int    cap_fcntl_check(struct filedesc *fdp, int fd, int cmd);
 
-extern int trap_enotcap;
+extern bool trap_enotcap;
 
 #else /* !_KERNEL */
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to