1 #include <sys/kern_sysctl.h>
2 #include <sys/sysctl.h>
3 #include <dispatch/dispatch.h>
4 #include <darwintest.h>
6 #include "test_utils.h"
9 is_development_kernel()
11 static dispatch_once_t is_development_once
;
12 static bool is_development
;
14 dispatch_once(&is_development_once
, ^{
16 size_t dev_size
= sizeof(dev
);
19 T_ASSERT_POSIX_SUCCESS(sysctlbyname("kern.development", &dev
,
20 &dev_size
, NULL
, 0), NULL
);
21 is_development
= (dev
!= 0);
24 return is_development
;