_RSLOBJ()--Resolve to an i5/OS Object for i5/OS PASE


  Syntax
 #include <as400_protos.h>

 int _RSLOBJ(ILEpointer       *sysptr,
             const char       *path,
             char             *objtype);

 int _RSLOBJ2(ILEpointer      *sysptr,
              unsigned short  type_subtype,  
              const char      *objname,
              const char      *libname);  

  Default Public Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes


Note: These functions can only be used in an i5/OS PASE program. See i5/OS PASE for more information about creating i5/OS PASE programs.

The _RSLOBJ() and _RSLOBJ2() functions resolve to an i5/OS object. They accept symbolic information that identifies the object and return a 16-byte tagged system pointer to the specified object.

Parameters

sysptr
(Output) Pointer to the i5/OS object. sysptr is the address of a 16-byte aligned buffer allocated by the caller and used to return a system pointer to the i5/OS object.

path
(Input) Pointer to an Integrated File System path name that locates the i5/OS object. path is the address of a null-terminated string in the i5/OS PASE CCSID that contains a path name for the i5/OS object.


objtype
(Output) Pointer to the returned i5/OS object type. objtype is the address of a buffer allocated by the caller and used to return a null-terminated string in the i5/OS PASE CCSID that identifies the i5/OS object type. If objtype is a null pointer, no i5/OS object type is returned. When objtype is not null, the caller must provide a buffer of length RSLOBJ_OBJTYPE_MAXLEN (11) to avoid errors.

type_subtype
(Input) Object type and subtype. type_subtype specifies the MI object type and MI object subtype of the i5/OS object. Header file <as400_types.h> declares these constants for type and subtype values:

RSLOBJ_TS_PGM
(0x0201)
Specifies the MI type and subtype for an i5/OS program (object type *PGM).
RSLOBJ_TS_SRVPGM
(0x0203)
Specifies the MI type and subtype for an i5/OS service program (object type *SRVPGM).

objname
(Input) Pointer to the name of the i5/OS object. objname is the address of a null-terminated string in the i5/OS PASE CCSID that contains the name of the i5/OS object.

libname
(Input) Pointer to the name of the i5/OS library that contains the object. libname is the address of a null-terminated string in the i5/OS PASE CCSID that contains the name of an i5/OS library. Specifying a null pointer or a pointer to a null string is the same as specifying "*LIBL", which searches the thread library list.


Authorities

Object Referred to Authority
Required
Every directory in the Integrated File System path to the i5/OS object *X
i5/OS library that contains the object *X

Return Value

The function result is zero if the i5/OS object was found and a system pointer was returned in the sysptr argument. A function result of -1 indicates an error that is further qualified by an errno value.


Error Conditions

Memory errors may be reported with an i5/OS exception message that the system converts to an i5/OS PASE signal (not return code and errno values). See i5/OS PASE Signal Handling for information about handling i5/OS exceptions.

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

[EACCES] Not authorized to a library or directory needed to resolve to the i5/OS object.

[EBUSY] A library or directory needed to resolve to the i5/OS object is currently in use (locked).

[EFAULT] A memory fault occurred attempting to reference an argument.

[EINVAL] An invalid argument value was specified.

[EINTER] An signal interrupted the operation.

[ENAMETOOLONG] Some component of the specified path is too long, or the entire path exceeds the system limit, or the objname or libname string is longer than 30 characters.

[ENOENT] The specified i5/OS object was not found.

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

[ELOOP] Too many levels of symbolic links.


Usage Notes

  1. For _RSLOBJ, alphabetic case is either ignored or honored depending on the attributes of the file system that contains the path. Alphabetic case is always honored by _RSLOBJ2, so the objname and libname strings must be uppercase.

Related Information




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