Kenwood HP 9000 Personal Computer User Manual


 
Chapter 6 241
Shared Library Management Routines
The dlopen Shared Library Management Routines
Return Values
A successful dlopen call returns to the process a handle which the
process can use on subsequent calls to dlsym and dlclose. This value
should not be interpreted in any way by the process.
dlopen returns NULL under the following conditions:
file cannot be found.
file cannot be opened for reading.
file is not a shared object.
An error occurs during the process of loading file or relocating its
symbolic references.
flags Mode Definition
RTLD_LAZY Under this mode, only references to data symbols are
relocated when the library t is loaded. References to functions
are not relocated until a given function is invoked for the first
time. This mode should result in better performance, since a
process may not reference all of the functions in any given
shared object.
RTLD_NOW Under this mode, all necessary relocations are performed
when the library is first loaded. This can cause some wasted
effort, if relocations are performed for functions that are
never referenced, but is useful for applications that need to
know as soon as an object is loaded that all symbols
referenced during execution are available.
RTLD_GLOBAL The shared library's symbols are made available for the
relocation processing of any other object. In addition, symbol
lookup using dlopen(0, mode) and an associated dlsym()
allows objects loaded with RTLD_GLOBAL to be searched.
RTLD_LOCAL The shared library’s symbols are made available for
relocation processing only to objects loaded in the same
dlopen invocation.
If neither RTLD_GLOBAL nor RTLD_LOCAL are specified, the
default is RTLD_LOCAL.
Parm Definition