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
26 .Fa "struct ps_prochandle *P"
27 .Fa "proc_lwp_f *func",
32 .Fa "struct ps_prochandle *P"
33 .Fa "proc_lwp_all_f *func"
41 functions iterates over threads in the given process handle
45 function iterates over all active threads, where as the
47 function iterates over both active threads and zombie threads -- threads
50 For each thread, the callback function
52 is called with the pointer to the private data argument,
59 function, the thread's
65 controls whether or not iteration continues.
70 then both functions will continue iteration.
73 returns non-zero, then iteration will halt and that value will be used
74 as the return value of the
79 Because both functions return
81 on internal failure, it is recommended that the callback function does
84 to indicate an error so that the caller may distinguish between the
85 failure of the callback function and the failure of the
91 Upon successful completion, the
97 Otherwise, if there was an internal error or there is no thread data, then
100 Otherwise, if the callback function
102 returns non-zero, then its return value will be returned instead.
103 .Sh INTERFACE STABILITY