_ILELOADX() and _ILELOAD()--Load an ILE Bound Program for IBM PASE for i


  Syntax
 #include <as400_protos.h>


 unsigned long long _ILELOADX(const void  *id,
                              unsigned int flags);


 int _ILELOAD(const void  *id,
              unsigned int flags);  


  Default Public Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes

Note: These functions can only be used in an IBM® i PASE program. See the IBM PASE for i topic collection for more information about creating IBM PASE for i programs.

The _ILELOADX() and _ILELOAD() functions load a bound program into the ILE activation group associated with the procedure that started IBM PASE for i (either the activation group that called the Qp2RunPase API, or the default activation group for a job running program QP2FORK).


Parameters

id
(Input) Pointer to the identification of the bound program.id is either the address of a null-terminated character string in the IBM PASE for i CCSID that names the program, or the address of a system pointer to the program, depending on the value of the flags argument.
flags
(Input) Specifies options to control how the bound program is found and activated. The flags argument is a bitwise logical-or of one or more of the following values:

ILELOAD_PATH
(0x00000000)
Specifies that the id argument is the address of a string that contains an absolute or relative path in the Integrated File System to a program or service program object. Alphabetic case is either ignored or honored depending on the attributes of the File System that contains the path. ILELOAD_PATH, ILELOAD_LIBOBJ, and ILELOAD_PGMPTR are mutually exclusive.
ILELOAD_LIBOBJ
(0x00000001)
Specifies that the id argument is the address of a string that contains a qualified library/object name of a service program (where omitting the library name implies resolving to the object through the job library list). Alphabetic case is honored when searching for a library/object name (so the string should be all uppercase). ILELOAD_PATH, ILELOAD_LIBOBJ, and ILELOAD_PGMPTR are mutually exclusive.
ILELOAD_PGMPTR
(0x00000002)
Specifies that the id argument is the address of a system pointer to the bound program (object type *SRVPGM or *PGM) to load. ILELOAD_PATH, ILELOAD_LIBOBJ, and ILELOAD_PGMPTR are mutually exclusive.


Authorities

_ILELOADX and _ILELOAD call the ILE QleActBndPgmLong API to activate the bound program. See Activate Bound Program Long (QleActBndPgmLong) API for information about authorities required to use _ILELOADX and _ILELOAD.


Return Value

A function result of -1 indicates an error that is further qualified by an errno value. If the bound program was successfully activated (including the case where it was already activated before _ILELOADX or _ILELOAD ran), the function result is an activation mark that uniquely identifies the activation within the process. 64-bit ILE activation mark values can only be returned using _ILELOADX.


Error Conditions

Memory errors and errors while activating the bound program may be reported with an IBM i exception message that the system converts to an IBM PASE for i signal (not return code and errno values). See IBM PASE for i Signal Handling for information about handling IBM i exceptions.

At least these errno values can be returned, with other values also possible (such as IBM i-unique ILE errno EAPAR):

[EACCES] Not authorized to a library or directory needed to resolve the id.

[EBUSY] A library or directory needed to resolve the specified id is currently in use (locked).

[EFAULT] A memory fault occurred attempting to reference the id.

[EINVAL] An invalid argument value was specified.

[EINTER] An signal interrupted the operation.

[ENAMETOOLONG] Some component of the specified id is too long, or the entire id exceeds the system limit.

[ENOENT] No file/object was found for the specified id.

[ENOTDIR] A qualifier part of the id is not a directory.

[ELOOP] Too many levels of symbolic links.


Related Information



API introduced: V4R5

[ Back to top | IBM PASE for i APIs | APIs by category ]