introspection_get_mapped_object_path()

Get the path of a mapped object

Synopsis:

#include <sys/introspection.h>

int introspection_get_mapped_object_path( pid64_t pid64,
                                          uintptr_t vaddr,
                                          struct _procfs_debug_info *info,
                                          size_t bsize );

Arguments:

pid64
The PID (pid_t) or unique PID (pid64_t) of the target process.
vaddr
The address of the object.
info
The buffer to store the data.
bsize
The size of the provided buffer.

Library:

libintrospection

Use the -l introspection option to qcc to link against this library.

Description:

The introspection_get_mapped_object_path() function gets the path of a mapped object. A mapped object can be:
  • a file
  • a shared memory object
  • typed memory
  • an elf object (shared library, executable). In this case, the function also returns the relocation offset of the elf object, i.e., the difference of its load address in the elf file and the actual address in memory.
For example, a dumper can use this function to obtain the list of shared libraries a process has loaded.
Note:
Your process must have the PROCMGR_AID_XPROCESS_QUERY ability enabled to request information about another process.

Returns:

The size of the mapped object path including its terminating zero, on success. If an error occurs, the function returns the negative of a value from the Errors section.

Errors:

EFAULT
Error accessing the output buffer.
ENXIO
There was no object mapped at the given address.
EPERM
The calling process doesn't have the required ability.
ESRCH
The PID is invalid.

Classification:

QNX OS

Safety:
Cancellation point Yes
Signal handler Yes
Thread Yes
Page updated: