]>
git.saurik.com Git - apple/xnu.git/blob - tests/pid_for_task_test.c
2 #include <darwintest.h>
5 T_DECL(pid_for_task_test
, "Test pid_for_task with task name port")
11 kr
= task_name_for_pid(mach_task_self(), getpid(), &tname
);
12 T_EXPECT_EQ(kr
, 0, "task_name_for_pid should succeed on current pid");
13 pid_for_task(tname
, &pid
);
14 T_EXPECT_EQ(pid
, getpid(), "pid_for_task should return the same value as getpid()");
16 mach_port_deallocate(mach_task_self(), tname
);