Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Plwp_iter.3proc.man.txt
+++ new/usr/src/man/man3proc/Plwp_iter.3proc.man.txt
1 1 PLWP_ITER(3PROC) Process Control Library Functions PLWP_ITER(3PROC)
2 2
3 3 NAME
4 4 Plwp_iter, Plwp_iter_all - iterate over threads
5 5
6 -SYNOPSIS
6 +LIBRARY
7 7 Process Control Library (libproc, -lproc)
8 +
9 +SYNOPSIS
8 10 #include <libproc.h>
9 11
10 12 int
11 13 Plwp_iter(struct ps_prochandle *P, proc_lwp_f *func, void *data);
12 14
13 15 int
14 16 Plwp_iter_all(struct ps_prochandle *P, proc_lwp_all_f *func, void *data);
15 17
16 18 DESCRIPTION
17 19 The Plwp_iter() and Plwp_iter_all() functions iterates over threads in
18 20 the given process handle P. The Plwp_iter() function iterates over all
19 21 active threads, where as the Plwp_iter_all() function iterates over both
20 22 active threads and zombie threads -- threads waiting to be reaped.
21 23
22 24 For each thread, the callback function func is called with the pointer to
23 25 the private data argument, data, and the thread's lwpstatus_t structure.
24 26 In the case of the Plwp_iter_all() function, the thread's lwpsinfo_t is
25 27 also included.
26 28
27 29 The return value of func controls whether or not iteration continues. If
28 30 func returns 0, then both functions will continue iteration. However, if
29 31 func returns non-zero, then iteration will halt and that value will be
30 32 used as the return value of the Plwp_iter() and Plwp_iter_all()
31 33 functions. Because both functions return -1 on internal failure, it is
32 34 recommended that the callback function does not return -1 to indicate an
33 35 error so that the caller may distinguish between the failure of the
34 36 callback function and the failure of the Plwp_iter() and Plwp_iter_all()
35 37 functions.
36 38
37 39 RETURN VALUES
38 40 Upon successful completion, the Plwp_iter() and Plwp_iter_all() functions
39 41 return 0. Otherwise, if there was an internal error or there is no
40 42 thread data, then -1 is returned. Otherwise, if the callback function
41 43 func returns non-zero, then its return value will be returned instead.
42 44
43 45 INTERFACE STABILITY
44 46 Uncommitted
45 47
46 48 MT-LEVEL
47 49 See LOCKING in libproc(3LIB).
48 50
49 51 SEE ALSO
50 52 libproc(3LIB)
51 53
52 54 illumos May 11, 2016 illumos
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX