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.
15 .Dt PMAPPING_ITER 3PROC
19 .Nm Pmapping_iter_resolved ,
21 .Nm Pobject_iter_resolved
22 .Nd iterate over process mappings and objects
28 .Fa "struct ps_prochandle *P"
29 .Fa "proc_map_f *func"
33 .Fo Pmapping_iter_resolved
34 .Fa "struct ps_prochandle *P"
35 .Fa "proc_map_f *func"
40 .Fa "struct ps_prochandle *P"
41 .Fa "proc_map_f *func"
45 .Fo Pobject_iter_resolved
46 .Fa "struct ps_prochandle *P"
47 .Fa "proc_map_f *func"
54 .Fn Pmapping_iter_resolved
55 functions iterate over the memory mappings in the process represented by
58 For each memory mapping, the callback function
60 will be invoked and it will be passed the
65 structure defined from
67 and a name of the mapping.
68 The way that the name is obtained varies based on whether one calls
71 .Fn Pmapping_iter_resolved .
72 In both cases, the dynamic linker is consulted to determine the file
73 name for the mapping, if it's known.
74 If the name is unknown, for example an anonymous mapping, then the
76 pointer is passed in for the name.
78 .Fn Pmapping_iter_resolved
79 function the system tries to resolve it to a complete file system path.
80 If that fails, it falls back to the information from the dynamic linker,
83 in the case of not being able to find any name.
84 For more information on the
92 controls whether or not iteration continues.
97 then iteration continues.
100 returns non-zero then iteration will halt and the value will be
101 returned to the caller.
104 indicates internal failure, it is recommended that the callback function not
107 to indicate an error itself.
108 This allows the caller to distinguish between failure of the callback function
109 versus failure of the
112 .Fn Pmapping_iter_resolved
118 .Fn Pobject_iter_resolved
119 functions are similar to the
122 .Fn Pmapping_iter_resolved
124 Except, rather than iterating over every mapping, they iterate over the objects
125 that the process has loaded by the dynamic linker.
126 For example, an anonymous mapping will show up when iterating mappings, but will
127 not show up when iterating objects.
128 Further, while most dynamic shared objects have multiple mappings for the text
129 and data sections, there will only be a single object that is iterated over.
131 The distinction between the
134 .Fn Pobject_iter_resolved
135 functions is identical to the difference in name resolution between the
138 .Fn Pmapping_iter_resolved
141 Upon successful completion, the
143 .Fn Pmapping_iter_resolved
146 .Fn Pobject_iter_resolved
149 Otherwise, if there was an internal error then
152 Otherwise, if the callback function
154 returns non-zero, then its return value will be returned instead.
155 .Sh INTERFACE STABILITY