PROC_FDINFOWALK(3PROC) | Process Control Library Functions | PROC_FDINFOWALK(3PROC) |
proc_fdinfowalk
—
walk the additional miscellaneous information in a
prfdinfo_t structure
Process Control Library (libproc, -lproc)
#include
<libproc.h>
int
proc_fdinfowalk
(const prfdinfo_t
*info, proc_fdinfowalk_f *func,
void *arg);
The
proc_fdinfowalk
()
function walks a prfdinfo_t structure and calls the
callback function func once for each miscellaneous
item of information present, along with the user-specified
arg. The definition of
proc_fdinfowalk_f
is available in libproc(3LIB). The
miscellaneous data types and structures are found in the
fdinfo section of
proc(5).
func will be called once for each miscellaneous item, providing the item's type, size and address. The size may include trailing padding bytes which will be set to zero.
The return value of the caller's func function determines whether or not iteration will continue. If func returns a non-zero value, then iteration will terminate and that return value will be returned to the caller. To distinguish between system errors and caller errors, it is recommended that the function only return positive integers in the event of an error.
Upon successful completion, the
proc_fdinfowalk
() function returns
0. Otherwise,
-1 is returned
and
errno is
updated to reflect the error that occurred.
In addition to the errors listed below, the
proc_fdinfowalk
() function may fail for the same
reasons as the opendir(3C),
readdir(3C), and
malloc(3C) functions.
malloc(3C), opendir(3C), readdir(3C), libproc(3LIB), proc(5)
November 27, 2023 | OmniOS |