]> git.saurik.com Git - apple/launchd.git/blob - launchd/testing/vproc_gsk_test.c
launchd-392.39.tar.gz
[apple/launchd.git] / launchd / testing / vproc_gsk_test.c
1 #include <stdio.h>
2 #include <stdbool.h>
3 #include <assert.h>
4 #include <vproc.h>
5
6 int main(void)
7 {
8 int64_t val;
9 bool is_native;
10 pid_t p;
11 uid_t u;
12
13 /* we assign val to p or u due to 64 bit to 32 bit trucation */
14
15 assert(vproc_swap_integer(NULL, VPROC_GSK_MGR_PID, NULL, &val) == NULL);
16 p = val;
17
18 assert(vproc_swap_integer(NULL, VPROC_GSK_MGR_UID, NULL, &val) == NULL);
19 u = val;
20
21 assert(vproc_swap_integer(NULL, VPROC_GSK_IS_NATIVE, NULL, &val) == NULL);
22 is_native = val;
23
24 fprintf(stdout, "UID = %u PID = %u Native = %u\n", u, p, is_native);
25
26 return 0;
27 }