|PROC_WALK(3PROC)||Process Control Library Functions||PROC_WALK(3PROC)|
proc_walk — walk
all processes or threads in /proc
Process Control Library (libproc, -lproc)
void *arg, int flag);
function walks all threads and processes in /proc and calls the callback
function func once for each one with the user
specified arg. The definition of the
is available in libproc(3LIB).
func will be called once for each process and will always have its first argument filled in with the value of the psinfo file of the process. The value of flag controls whether or not information about the threads in the process are included and how many times the callback function func is called. The following values may be passed in for flag:
In addition, the following values may be combined with one of the above values of flag with a bitwise-inclusive-OR:
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.
|December 2, 2019||OmniOS|