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.
20 .Nd iterate over threads
27 .Fa "struct ps_prochandle *P"
28 .Fa "proc_lwp_f *func",
33 .Fa "struct ps_prochandle *P"
34 .Fa "proc_lwp_all_f *func"
42 functions iterates over threads in the given process handle
46 function iterates over all active threads, where as the
48 function iterates over both active threads and zombie threads -- threads
51 For each thread, the callback function
53 is called with the pointer to the private data argument,
60 function, the thread's
66 controls whether or not iteration continues.
71 then both functions will continue iteration.
74 returns non-zero, then iteration will halt and that value will be used
75 as the return value of the
80 Because both functions return
82 on internal failure, it is recommended that the callback function does
85 to indicate an error so that the caller may distinguish between the
86 failure of the callback function and the failure of the
92 Upon successful completion, the
98 Otherwise, if there was an internal error or there is no thread data, then
101 Otherwise, if the callback function
103 returns non-zero, then its return value will be returned instead.
104 .Sh INTERFACE STABILITY