The shl_gethandle and shl_gethandle_r Routines
The shl_gethandle and shl_gethandle_r routines return descriptor information about a loaded shared library.
Syntax
int shl_gethandle( shl_t handle,
struct shl_descriptor **desc )
Parameters
handle The handle of the shared library you want information about. This handle is the same as that returned by shl_load. desc Points to shared library descriptor information - the same information returned by the shl_get routine. The buffer used to store this desc information is static, meaning that subsequent calls to shl_gethandle overwrites the same area with new data. Therefore, if you need to save the desc information, copy it elsewhere before calling shl_gethandle again.
Return Value
If handle is not valid, the routine returns
Description
The shl_gethandle routine returns descriptor information about a loaded shared library. If you are programming in a threaded environment, use the
Example
The following function named show_lib_info displays information about a shared library, given the library's handle.
show_lib_info - Display Information for a Shared Library
#include <stdio.h> #include <dl.h>
int show_lib_info(shl_t libH)
{
struct shl_descriptor *desc;
if (shl_gethandle(libH, &desc) ==
{
fprintf(stderr, "Invalid library handle.\\n"); return
} |
|
printf("library path: | %s\\n", |
printf("text start: | %#10lx\\n", |
printf("text end: | %#10lx\\n", |
printf("data start: | %#10lx\\n", |
printf("data end: | %#10lx\\n", |
return 0; |
|
}
The shl_definesym Routine
The shl_definesym routine adds new symbols to the global shared library symbol table.
The shl_load Shared Library Management Routines 177