|PROC_FDWALK(3PROC)||Process Control Library Functions||PROC_FDWALK(3PROC)|
proc_fdwalk — walk
the open file descriptors for a process
Process Control Library (libproc, -lproc)
proc_fdwalk_f *func, void
function walks all file descriptors currently open in the process with ID
pid and calls the callback function
func once for each file descriptor with the
user-specified arg. The definition of
proc_fdwalk_f is available in
func will be called once for each file descriptor and will have its first argument filled in with the contents of the corresponding /proc fdinfo file for the file descriptor.
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.
|January 6, 2020||OmniOS|