]>
git.saurik.com Git - apple/xnu.git/blob - tools/tests/unit_tests/pipes_fill_procinfo_11179336.c
9 if (pipe(&pipe_fds
[0]) < 0) {
13 struct pipe_fdinfo pdinfo
;
15 int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
18 int flavor
= PROC_PIDFDPIPEINFO
;
19 int nv
= proc_pidfdinfo(mypid
, pipe_fds
[0], flavor
, (void *) &pdinfo
, sizeof(pdinfo
));
21 perror("proc_pidinfo");
24 printf("handle value = %p \n", (void *)pdinfo
.pipeinfo
.pipe_handle
);
26 fstat(pipe_fds
[0], &mystat
);
27 printf("ino value = %p \n", (void *)mystat
.st_ino
);
29 if ( (uintptr_t)mystat
.st_ino
== (uintptr_t)pdinfo
.pipeinfo
.pipe_handle
)
32 printf("[FAILED] fill_pipeinfo returned wrong values. (i.e. pipeinfo->pipe_handle != fstat->st_ino ) \n");
35 printf("[PASSED] fill_pipeinfo returned correct values. (i.e. pipeinfo->pipe_handle == fstat->st_ino ) \n");