1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
6 #include <sys/sysctl.h>
13 int mib
[] = {CTL_KERN
, KERN_OSTYPE
};
15 char *buf
= (char *)asysctl(mib
, __arraycount(mib
), &len
);
18 printf("asysctl: '%s' size: '%zu'\n", buf
, len
);
23 void test_asysctlbyname() {
25 char *buf
= (char *)asysctlbyname("kern.ostype", &len
);
28 printf("asysctlbyname: '%s' size: '%zu'\n", buf
, len
);
42 // CHECK: asysctl: '{{.*}}' size: '{{.*}}'
43 // CHECK: asysctlbyname: '{{.*}}' size: '{{.*}}'