Change trap_enotcap to bool and annotate with __read_frequently

It is read on each return to user space.
This commit is contained in:
Mateusz Guzik 2018-05-07 23:10:12 +00:00
parent 79ca7cbf09
commit 75e9b455a9
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -370,7 +370,7 @@ int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd);
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 */