The realpath service derives, from the pathname that is pointed to by Pathname, an absolute pathname that names the same file, whose resolution does not involve dot (.), dot-dot (..), or symbolic links.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RPH): | 31-bit |
AMODE (BPX4RPH): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4RPH with the same parameters.
The name of a fullword that contains the length of the pathname that is to be resolved.
The name of a field that contains the pathname that is to be resolved. The length of this field is specified in Pathname_length.
The name of a fullword that contains the length of the buffer to which the realpath service returns an absolute pathname without dot (.), dot-dot (..), or symbolic links. Resolved_name_length must be large enough to accommodate the actual length of an absolute pathname, plus one (for the terminating null). A length of zero has special meaning; see the usage notes.
The name of the buffer that is to hold the absolute pathname that is to be generated for the input Pathname. The length of this field is specified in Resolved_name_length.
The name of a fullword in which the realpath service returns the length of the pathname that is in the buffer, if the request is successful; or -1, if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The calling process does not have permission to search one of the components of Pathname. |
EINVAL | There was a parameter error; for example, Resolved_name_length is not valid. The following reason codes can accompany the return code: JRBuffLenInvalid and JRBadAddress. |
EIO | An input/output error occurred. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Pathname argument. This error is issued if more than 24 symbolic links are detected in the resolution of Pathname. |
ENAMETOOLONG | Pathname is longer than 1023 characters; or a component of Pathname is longer than 255 characters. Name truncation is not supported. |
ENOENT | No file named Pathname was found; or no pathname was specified. The following reason code can accompany the return code: JRFileNotThere. |
ENOTDIR | Some component of Pathname is not a directory. |
ENOMEM | Insufficient storage space is available. The following reason code can accompany the return code: JRNoStorage. |
ERANGE | The specified Resolved_name_length is less than the length of the pathname that was generated for the input Pathname. The specified Resolved_name_length is zero, and the length of the pathname that was generated for the input Pathname is larger than PATH_MAX bytes. The following reason code can accompany the return code: JrBuffTooSmall. |
The name of a fullword in which the realpath service stores the reason code. The realpath service returns a Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
There are no restrictions on the use of the realpath service.
For an example using this callable service, see BPX1RPH (realpath) example.