Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (a - e) dlsym(3)
someData *theData; // pointer to structure
// variable "theData" in "mydll"
dlHandle handle; // handle from loading "mydll"
handle = dlopen("mydll",RTLD_NOW);
if (! handle) ... // error handling
theFunction = (someFunction_p)dlsym(handle,"theFunction");
if (! theFunction) ... //error handling
theData = (someData*)dlsym(handle,"theData");
if (! theData) ... // error handling
RETURN VALUES
If the dlsym() function detects that a dlopen_handle value is not valid, or if symbol_name cannot
be found within any of the loadfiles associated with a valid dlopen_handle, the function returns 0
(zero) and the dlerror() or dlresultcode() function should be called immediately to determine
the problem. Otherwise, the address of the symbol is returned.
ERRORS
The dlsym( ) function does not set the errno variable. Error information is available through the
dlerror() or dlresultcode() function.
RELATED INFORMATION
Functions: dlclose(3), dlerror(3), dlopen(3), dlresultcode(3).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specification.
527192-007 Hewlett-Packard Company 1−65