POBJNAME(3PROC) Process Control Library Functions POBJNAME(3PROC)
NAME
Pobjname,
Pobjname_resolved - turn a virtual address into its mapped
object
LIBRARY
Process Control Library (libproc, -lproc)
SYNOPSIS
#include <libproc.h> char * Pobjname(
struct ps_prochandle *P,
uintptr_t addr,
char *buffer,
size_t bufsize);
char * Pobjname_resolved(
struct ps_prochandle *P,
uintptr_t addr,
char *buffer,
size_t bufsize);
DESCRIPTION
The
Pobjname() and
Pobjname_resolved() functions attempt to determine
the underlying mapped object that contains the virtual address
addr in
the process handle
P.
A program consists of multiple memory mappings. Some are provided by
the system, such as the stack and the heap. While others are created
through explicit calls to
mmap(2) or brought in by the run-time link-
editor due to dependencies specified in binaries and libraries.
If
addr is contained in a mapping, then up to
bufsize characters,
including the null terminator, of the name of the corresponding object
will be written into
buffer. The
Pobjname_resolved() function attempts
to resolve the object to a full file system path. If the full file-
system path cannot be determined, then it will fall back to the name
that the run-time link-editor has for that mapping, which is the
behavior of
Pobjname().
RETURN VALUES
Upon successful completion, the
Pobjname() and
Pobjname_resolved()
functions return
buffer. Otherwise, NULL is returned to indicate the
object name could not be found.
INTERFACE STABILITY
UncommittedMT-LEVEL See
LOCKING in
libproc(3LIB).
SEE ALSO
mmap(2),
libproc(3LIB),
Pobject_iter(3PROC),
proc(5)illumos May 11, 2016 illumos