#include <qp2user.h> QP2_ptr64_t Qp2dlopen(const char *path, int flags, int ccsid);
Qp2dlopen() dynamically loads an IBM® i PASE module by calling the IBM PASE for i dlopen() function.
If the input path pointer is null, the function result is a value for the main application that lets you find symbols in the IBM PASE for i process global name space, which includes all symbols exported by the IBM PASE for i program and shared executables except those loaded by IBM PASE for i dlopen using option RTLD_LOCAL.
QP2_RTLD_NOW (0x00000002) | Load all dependents of the module being loaded
and resolve all symbols. Either QP2_RTLD_NOW or QP2_RTLD_LAZY must be
specified. |
QP2_RTLD_LAZY (0x00000004) | Allow the system to defer loading dependent
modules. Either QP2_RTLD_NOW or QP2_RTLD_LAZY must be specified. |
QP2_RTLD_GLOBAL (0x00010000) | Load the module into the global name space.
Exported symbols in the module will be visible in the main application and will
be used when resolving symbols used by other IBM PASE for i dlopen calls. |
QP2_RTLD_LOCAL (0x00080000) | Load the module into a local name space. This
option is the default when neither QP2_RTLD_GLOBAL nor QP2_RTLD_LOCAL is
specified. It prevents symbols in the module being loaded from being used when
resolving symbols used by other dlopen calls. |
QP2_RTLD_MEMBER (0x00040000) | Specifies that the path argument string
may contain the name of a member in an archive (shared library). |
QP2_RTLD_NOAUTODEFER (0x00020000) | Prevent deferred imports in the module being loaded from being automatically resolved by subsequent loads. |
Object Referred to | Authority Required |
---|---|
Each directory in the path to the IBM PASE for i module | *X |
IBM PASE for i module | *R |
Sucessful completion returns a non-zero function result that can be used to call APIs Qp2dlsym and Qp2dlclose (and also IBM PASE for i functions dlsym and dlclose). Resources allocated for the function result are not freed until the IBM PASE for i program ends or the value is passed to API Qp2dlclose (or IBM PASE for i dlclose).
A zero function result indicates an error. The caller can check ILE errno or IBM PASE for i errno (if ILE errno is zero), or call the Qp2dlerror API for more information about the error.