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/Pmapping_iter.3proc.man.txt
+++ new/usr/src/man/man3proc/Pmapping_iter.3proc.man.txt
1 1 PMAPPING_ITER(3PROC) Process Control Library Functions PMAPPING_ITER(3PROC)
2 2
3 3 NAME
4 4 Pmapping_iter, Pmapping_iter_resolved, Pobject_iter,
5 5 Pobject_iter_resolved - iterate over process mappings and objects
6 6
7 -SYNOPSIS
7 +LIBRARY
8 8 Process Control Library (libproc, -lproc)
9 +
10 +SYNOPSIS
9 11 #include <libproc.h>
10 12
11 13 int
12 14 Pmapping_iter(struct ps_prochandle *P, proc_map_f *func, void *data);
13 15
14 16 int
15 17 Pmapping_iter_resolved(struct ps_prochandle *P, proc_map_f *func,
16 18 void *data);
17 19
18 20 int
19 21 Pobject_iter(struct ps_prochandle *P, proc_map_f *func, void *data);
20 22
21 23 int
22 24 Pobject_iter_resolved(struct ps_prochandle *P, proc_map_f *func,
23 25 void *data);
24 26
25 27 DESCRIPTION
26 28 The Pmapping_iter() and Pmapping_iter_resolved() functions iterate over
27 29 the memory mappings in the process represented by P.
28 30
29 31 For each memory mapping, the callback function func will be invoked and
30 32 it will be passed the data argument, the prmap_t structure defined from
31 33 proc(4), and a name of the mapping. The way that the name is obtained
32 34 varies based on whether one calls Pmapping_iter() or
33 35 Pmapping_iter_resolved(). In both cases, the dynamic linker is consulted
34 36 to determine the file name for the mapping, if it's known. If the name
35 37 is unknown, for example an anonymous mapping, then the NULL pointer is
36 38 passed in for the name. In the case of the Pmapping_iter_resolved()
37 39 function the system tries to resolve it to a complete file system path.
38 40 If that fails, it falls back to the information from the dynamic linker,
39 41 before returning NULL in the case of not being able to find any name.
40 42 For more information on the signature of the proc_map_f, see
41 43 libproc(3LIB).
42 44
43 45 The return value of func controls whether or not iteration continues. If
44 46 func returns 0 then iteration continues. If func returns non-zero then
45 47 iteration will halt and the value will be returned to the caller.
46 48 Because -1 indicates internal failure, it is recommended that the
47 49 callback function not return -1 to indicate an error itself. This allows
48 50 the caller to distinguish between failure of the callback function versus
49 51 failure of the Pmapping_iter() and Pmapping_iter_resolved() functions.
50 52
51 53 The Pobject_iter() and Pobject_iter_resolved() functions are similar to
52 54 the Pmapping_iter() and Pmapping_iter_resolved() functions. Except,
53 55 rather than iterating over every mapping, they iterate over the objects
54 56 that the process has loaded by the dynamic linker. For example, an
55 57 anonymous mapping will show up when iterating mappings, but will not show
56 58 up when iterating objects. Further, while most dynamic shared objects
57 59 have multiple mappings for the text and data sections, there will only be
58 60 a single object that is iterated over.
59 61
60 62 The distinction between the Pobject_iter() and Pobject_iter_resolved()
61 63 functions is identical to the difference in name resolution between the
62 64 Pmapping_iter() and Pmapping_iter_resolved() functions.
63 65
64 66 RETURN VALUES
65 67 Upon successful completion, the Pmapping_iter(), Pmapping_iter_resolved()
66 68 Pobject_iter(), and Pobject_iter_resolved() functions return 0.
67 69 Otherwise, if there was an internal error then -1 is returned.
68 70 Otherwise, if the callback function func returns non-zero, then its
69 71 return value will be returned instead.
70 72
71 73 INTERFACE STABILITY
72 74 Uncommitted
73 75
74 76 MT-LEVEL
75 77 See LOCKING in libproc(3LIB).
76 78
77 79 SEE ALSO
78 80 libproc(3LIB), proc(4)
79 81
80 82 illumos May 11, 2016 illumos
↓ open down ↓ |
62 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX