2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2015 Joyent, Inc.
19 .Nd walk all processes or threads in /proc
25 .Fa "proc_walk_f *func"
32 function walks all threads and processes in /proc and calls the callback
35 once for each one with the user specified
43 will be called once for each process and will always have its first
44 argument filled in with the value of the
49 controls whether or not information about the threads in the process are
50 included and how many times the callback function
53 The following values may be passed in for
55 .Bl -tag -width Dv -offset indent
57 Indicates that the walker is only concerned with the process.
59 will be called once for each process in the system.
62 will be read for the process and passed to
64 The second argument, the one for the
69 The caller wants both process and thread information.
71 will be called once for each thread in the system.
72 In addition to the process
74 information, the ps specific information for a given thread will be
80 The return value of the caller's
82 function determines whether or not iteration will continue.
85 returns a non-zero value, then iteration will terminate and that
86 return value will be returned to the caller.
87 To distinguish between system errors and caller errors, it is recommended that
88 the function only return positive integers in the event of an error.
90 Upon successful completion, the
98 is updated to reflect the error that occurred.
100 In addition to the errors listed below, the
102 function may fail for the same reasons as the
110 .Fa flag is not one of
115 .Sh INTERFACE STABILITY