Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Pobject_iter (3PROC)

Name

Pmapping_iter, Pobject_iter - walk the address space mappings of a victim process

Synopsis

#include <libproc.h>
typedef int proc_map_f(void *cd, const prmap_t *, const char *);
int Pmapping_iter(ps_prochandle_t *Pr, proc_map_f *func, void *cd);
int Pobject_iter(ps_prochandle_t *Pr, proc_map_f *func, void *cd);

Description

The Pr argument identifies a victim process or core file attached to the controlling process by the create and grab interfaces. For more information, see the Pcreate(3PROC) and Pgrab(3PROC) man pages.

The Pmapping_iter() function iterates over the address space mappings of the victim process and calls the specified function for each mapping, passing it the specified cd argument, a pointer to the address space mapping structure, and a pointer to a string naming the mapping. The string pointer will be NULL if the mapping has no name, otherwise it will point to the name of a shared object associated with the mapping. The iteration is terminated by the first non-zero value returned by the specified function, or by reaching the end of the mappings. For more information, see the proc(5) man page.

The Pobject_iter() function iterates over the shared objects of the victim process and calls the specified function for each shared object, passing it the specified cd argument, a pointer to the address space mapping structure for the object, and a pointer to a string naming the object. The string pointer can never be NULL, but it can be an empty string. The iteration is terminated by the first non-zero value returned by the specified function, or by reaching the end of the objects.

Return Values

The Pmapping_iter() and Pobject_iter() functions return 0 or the first non-zero value returned by the specified callback function. There are no error returns.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Unsafe

See Also

libproc.h(3HEAD), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), proc(5)