dlget.3c (2010 09)

d
dlget(3C) dlget(3C)
(ELF Applications Only)
NAME
dlget() - retrieve information about a loaded module (program or shared library)
SYNOPSIS
cc [flag]... file...
-ldl [library ]...
#include <dlfcn.h>
void *dlget(int index,
struct load_module_desc *desc,
size_t desc_size);
Multithread Usage
This routine is thread-safe.
DESCRIPTION
dlget() is one of a family of routines that give the user direct access to the dynamic linking facilities.
dlget() returns information about a loaded module for a process. retrieves information about a load
module from an index specifying the placement of the load module in the dynamic loader’s search list. An
index of -1 requests information about the dynamic loader. An index of
-2 requests information about
the program file itself.
If successful,
dlget() returns a handle for the shared library as defined by the return value from
dlo-
pen().
desc must be preallocated by the user. The structure members are filled in by the dynamic loader with
information about the requested shared library.
A load_module_desc structure has the following members:
struct load_module_desc {
unsigned long text_base;
unsigned long text_size;
unsigned long data_base;
unsigned long data_size;
unsigned long unwind_base;
unsigned long linkage_ptr;
unsigned long phdr_base;
unsigned long tls_size;
unsigned long tls_start_addr;
}
desc_size specifies the size in bytes of the load_module_desc structure sent in by the user.
If a call to
dlget() is unsuccessful, a NULL pointer is returned and desc remains unchanged.
ERRORS
If
dlget() fails, a subsequent call to dlerrno() returns one of the following values:
[RTLD_ERR_CANT_APPLY_RELOC] Cannot apply relocation in library.
[RTLD_ERR_INV_BUFFER_ARGUMENT] Invalid descriptor argument.
[RTLD_ERR_INV_DESC_VERSION] Invalid descriptor version.
[RTLD_ERR_INV_LIB_INDEX] Invalid load module index.
[RTLD_ERR_NO_MEMORY] Out of memory.
[RTLD_ERR_SETCANCELSTATE_FAILED]
__thread_setcancelstate
failed on entry to or
exit from
dlget().
[RTLD_ERR_SIGENABLE_FAILED]
sigenable failed on exit from dlget().
[RTLD_ERR_SIGINHIBIT_FAILED]
siginhibit failed on entry to dlget().
AUTHOR
dlget() was developed by HP.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)