Qp2dlopen()--Dynamically Load an i5/OS PASE Module


  Syntax
 #include <qp2user.h>

 QP2_ptr64_t Qp2dlopen(const char  *path,
                       int         flags,
                       int         ccsid);  

  Service Program Name: QP2USER

  Default Public Authority: *USE

  Threadsafe: Yes

Qp2dlopen() dynamically loads an i5/OS PASE module by calling the i5/OS PASE dlopen() function.


Parameters

path
(Input) A pointer to a null-terminated string that identifies the stream file in the Integrated File System that contains the i5/OS PASE module to load. This API copies the input path string and converts the copy from the CCSID specified by the ccsid argument to the current i5/OS PASE CCSID (required by the i5/OS PASE 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 i5/OS PASE process global name space, which includes all symbols exported by the i5/OS PASE program and shared executables except those loaded by i5/OS PASE dlopen using option RTLD_LOCAL.



flags
(Input) Flags passed to the i5/OS PASE dlopen function to control its behavior. These constants, declared in qp2user.h, match constants in AIX header dlfcn.h (without the leading prefix, QP2_) and can be ORed together for the flags argument:

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 i5/OS PASE 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.


ccsid
(Input) Specifies the CCSID for the input path argument string. Zero means the path is in the (EBCDIC) job default CCSID.

Authorities

Object Referred to Authority
Required
Each directory in the path to the i5/OS PASE module *X
i5/OS PASE module *R

Return Value

Sucessful completion returns a non-zero function result that can be used to call APIs Qp2dlsym and Qp2dlclose (and also i5/OS PASE functions dlsym and dlclose). Resources allocated for the function result are not freed until the i5/OS PASE program ends or the value is passed to API Qp2dlclose (or i5/OS PASE dlclose).

A zero function result indicates an error. The caller can check ILE errno or i5/OS PASE errno (if ILE errno is zero), or call the Qp2dlerror API for more information about the error.


Related Information



API introduced: V5R2
Top | i5/OS PASE APIs | APIs by category