6 #include <mach/mach_types.h>
7 #include <darwintest.h>
8 #include <darwintest_utils.h>
10 T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
12 T_DECL(debug_control_port_for_pid_success
,
13 "Verify that with debug_port entitlement you can call debug_control_port_for_pid",
14 T_META_ASROOT(true), T_META_CHECK_LEAKS(false))
17 T_SKIP("test requires root privileges to run.");
20 mach_port_t port
= MACH_PORT_NULL
;
21 T_ASSERT_MACH_SUCCESS(debug_control_port_for_pid(mach_task_self(), 1, &port
), "debug_control_port_for_pid");
22 T_EXPECT_NE(port
, MACH_PORT_NULL
, "debug_port");
23 mach_port_deallocate(mach_task_self(), port
);