rld Manual
Using the rld Loader Library
RLD Manual—528857-006
2-2
dlopen()
dlopen()
Summary
The dlopen() function opens a DLL loadfile from a running process.
Syntax for C/C++ Programmers
Parameters
object_pathname
points to the null-terminated file name of the DLL to be opened.
If object_pathname is null (zero), the dlopen function returns a library handle
that can be used with the dlsym function to look for symbols in the program and in
other DLLs that were loaded with it.
A value other than null must be consistent with the execution environment
(Guardian or OSS). If the file is an OSS file, the value specified must be an OSS
pathname. If the file is a Guardian file, the value specified must be a Guardian file
name.
int mode
is any valid combination of the following modes:
RTLD_NOW performs all linking on the newly loaded library immediately.
RTLD_LAZY is equivalent to RTLD_NOW. If either value is used, dlopen uses
RTLD_NOW. RTLD_LAZY is accepted to provide compatibility with UNIX
platforms.
RTLD_GLOBAL adds the newly loaded DLLs to the cumulative loadList; that
is, adds new DLLs to the global set, which consists of the program and DLLs
that rld loaded initially. This is a default value.
RTLD_LOCAL is equivalent to RTLD_GLOBAL. If either value is used,
dlopen() uses RTLD_GLOBAL. RTLD_LOCAL is accepted to provide
compatibility with UNIX platforms.
RTLD_NOLOAD specifies that dlopen() must not load the target library, but
must provide a unique library handle for it if the library is already loaded. This
option causes dlopen() to return a 0 (zero) if the library is not already
#include <dlfcn.h>
dlHandle dlopen (
const char *object_pathname,
int mode
);