Kenwood HP 9000 Personal Computer User Manual


 
Chapter 6 253
Shared Library Management Routines
The dlopen Shared Library Management Routines
Return Values
dlgetname returns the pathname of a load module represented by desc.
If desc does not describe a loaded module, dlgetname returns NULL.
Description
dlgetname is one of a family of routines that give the user direct access
to the dynamic linking facilities.
The read_tgt_mem, ident_parm, and load_map_parm parameters are
identical to those for dlmodinfo.
The caller of dlgetname must copy the return value to insure that it is
not corrupted.
Example
The following code sequence shows how to use dlgetname to retrieve the
pathname of a load module. This example uses dlget to get a
load_module_desc of the required load module and passes that
load_module_desc to dlgetname to retrieve the pathname.
void*handle;
struct load_module_desc desc;
char* dll_name;
/* Get load module of the index’th shared library */
handle = dlget(1, &desc, sizeof(struct load_module_desc));
/* Retrieve pathname of the shared library */
dll_name = dlgetname(&desc,
sizeof(struct load_module_desc),
NULL,
0,
NULL);
printf(“pathname of 1st shared library : %s\n”, dll_name);
The dlclose Routine
Closes a shared library.
Syntax
int dlclose(void *handle);