aboutsummaryrefslogtreecommitdiff
path: root/contrib/capsicum-test/sysctl.cc
blob: 7cbd3e8cbbf85550f7460691070e0130109d3f9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "capsicum.h"
#include "capsicum-test.h"

#ifdef HAVE_SYSCTL
#include <sys/sysctl.h>

// Certain sysctls are permitted in capability mode, but most are not.  Test
// for the ones that should be, and try one or two that shouldn't.
TEST(Sysctl, Capability) {
  int oid[2] = {CTL_KERN, KERN_OSRELDATE};
  int ii;
  size_t len = sizeof(ii);
  EXPECT_OK(sysctl(oid, 2, &ii, &len, NULL, 0));
}
#endif