1 PFDINFO_ITER(3PROC) Process Control Library Functions PFDINFO_ITER(3PROC) 2 3 NAME 4 Pfdinfo_iter - iterate open files in a process 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Pfdinfo_iter(struct ps_prochandle *P, proc_fdinfo_f *func, void *data); 14 15 DESCRIPTION 16 The Pfdinfo_iter() function iterates over the open files in the process 17 represented by P. 18 19 For each open file, the callback function func will be invoked and it 20 will be passed the data argument as well as a pointer to a prfdinfo_t 21 structure defined in libproc(3LIB). For the full signature of the 22 proc_fdinfo_f see libproc(3LIB). 23 24 The return value of func controls whether or not iteration continues. If 25 func returns 0, then iteration will continue. However, if func instead 26 returns a non-zero value, then iteration will halt and that value will be 27 used as the return value of the Pfdinfo_iter() function. Because the 28 Pfdinfo_iter() function returns -1 to an indicate its own errors, it is 29 recommended that the callback function does not return -1 to indicate an 30 error so that the caller may distinguish between the failure of the 31 callback function and the failure of the Pfdinfo_iter() function. 32 33 RETURN VALUES 34 Upon successful completion, the Pfdinfo_iter() returns 0. Otherwise, if 35 there was an internal error then -1 is returned. Otherwise, if the 36 callback function func returns non-zero, then its return value will be 37 returned instead. 38 39 INTERFACE STABILITY 40 Uncommitted 41 42 MT-LEVEL 43 See LOCKING in libproc(3LIB). 44 45 SEE ALSO 46 libproc(3LIB) 47 48 illumos May 11, 2016 illumos