1*2c2f96dcSApple OSS Distributions #include <sys/sysctl.h>
2*2c2f96dcSApple OSS Distributions #include <darwintest.h>
3*2c2f96dcSApple OSS Distributions #include <darwintest_utils.h>
4*2c2f96dcSApple OSS Distributions
5*2c2f96dcSApple OSS Distributions T_GLOBAL_META(
6*2c2f96dcSApple OSS Distributions T_META_NAMESPACE("xnu.ipc"),
7*2c2f96dcSApple OSS Distributions T_META_RADAR_COMPONENT_NAME("xnu"),
8*2c2f96dcSApple OSS Distributions T_META_RADAR_COMPONENT_VERSION("IPC"),
9*2c2f96dcSApple OSS Distributions T_META_CHECK_LEAKS(false));
10*2c2f96dcSApple OSS Distributions
11*2c2f96dcSApple OSS Distributions static int64_t
run_sysctl_test(const char * t,int64_t value)12*2c2f96dcSApple OSS Distributions run_sysctl_test(const char *t, int64_t value)
13*2c2f96dcSApple OSS Distributions {
14*2c2f96dcSApple OSS Distributions char name[1024];
15*2c2f96dcSApple OSS Distributions int64_t result = 0;
16*2c2f96dcSApple OSS Distributions size_t s = sizeof(value);
17*2c2f96dcSApple OSS Distributions int rc;
18*2c2f96dcSApple OSS Distributions
19*2c2f96dcSApple OSS Distributions snprintf(name, sizeof(name), "debug.test.%s", t);
20*2c2f96dcSApple OSS Distributions rc = sysctlbyname(name, &result, &s, &value, s);
21*2c2f96dcSApple OSS Distributions T_ASSERT_POSIX_SUCCESS(rc, "sysctlbyname(%s)", t);
22*2c2f96dcSApple OSS Distributions return result;
23*2c2f96dcSApple OSS Distributions }
24*2c2f96dcSApple OSS Distributions
25*2c2f96dcSApple OSS Distributions T_DECL(waitq_basic, "General waitq test",
26*2c2f96dcSApple OSS Distributions T_META_RUN_CONCURRENTLY(false))
27*2c2f96dcSApple OSS Distributions {
28*2c2f96dcSApple OSS Distributions T_EXPECT_EQ(1ull, run_sysctl_test("waitq_basic", 0), "waitq_basic_test");
29*2c2f96dcSApple OSS Distributions }
30