xref: /freebsd/contrib/capsicum-test/sysctl.cc (revision 911f0260390e18cf85f3dbf2c719b593efdc1e3c)
1 #include "capsicum.h"
2 #include "capsicum-test.h"
3 
4 #ifdef HAVE_SYSCTL
5 #include <sys/sysctl.h>
6 
7 // Certain sysctls are permitted in capability mode, but most are not.  Test
8 // for the ones that should be, and try one or two that shouldn't.
9 TEST(Sysctl, Capability) {
10   int oid[2] = {CTL_KERN, KERN_OSRELDATE};
11   int ii;
12   size_t len = sizeof(ii);
13   EXPECT_OK(sysctl(oid, 2, &ii, &len, NULL, 0));
14 }
15 #endif
16