xref: /freebsd/contrib/capsicum-test/sysctl.cc (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
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