cc [ flag ... ] file ... -ldl [ library ... ] #include <dlfcn.h> #include <link.h>int dlinfo(void *handle, int request, void *p);
The dlinfo() function extracts information about a dynamically-loaded object. This function is loosely modeled after the ioctl() function. The request argument and a third argument with varying type are passed to dlinfo(). The action taken by dlinfo() depends on the value of the request provided. The handle argument is a value returned from a dlopen() or dlmopen() call.
The following are possible values for request to be passed into dlinfo():
obtain the configuration file name and the address at which it has been loaded. The p argument is a Dl_info pointer ( Dl_info *p). The following elements from this structure are initialized:
The full name of the configuration file.
The base address of the configuration file loaded into memory.
obtain the ID for the link-map list upon which the handle is loaded. The p argument is a Lmid_t pointer ( Lmid_t *p).
obtain the Link_map for the handle specified. The p argument points to a Link_map pointer ( Link_map **p ). The actual storage for the Link_map structure is maintained by ld.so.1.
unsigned long l_addr; /* base address */ char * l_name; /* object name */ Elf32_Dyn * l_ld; /* .dynamic section */ Link_map * l_next; /* next link object */ Link_map * l_prev; /* previous link object */ char * l_refname; /* filter reference name */
The base address of the object loaded into memory.
The full name of the loaded object. This is the filename of the object as referenced by ld.so.1.
Points to the SHT_DYNAMIC structure.
The next Link_map on the link-map list, other objects on the same link-map list as the current object may be examined by following the and l_prev fields.
The previous Link_map on the link-map list.
If the object referenced is a filter this field points to the name of the object being filtered. If the object is not a filter, this field will be 0. See Linker and Libraries Guide.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
These functions are available to dynamically-linked processes only.