The readlink callable service reads the contents of a symbolic link into a buffer that you provide. The symbolic link contains the pathname that was specified when the symbolic link was defined (see symlink (BPX1SYM, BPX4SYM) — Create a symbolic link to a path name).
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RDL): | 31-bit |
AMODE (BPX4RDL): | 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 BPX4RDL with the same parameters. The Buffer_address parameter is a doubleword.
The name of a fullword that contains the length of Link_name.
The name of a field that contains the link name of the symbolic link that is to be read. The length of this field is specified in Link_name_length.
The name of a fullword that contains the length, in bytes, of the buffer that is pointed to by Buffer_address.
The name of a fullword (doubleword) that contains the address of the buffer that is supplied to readlink, into which the value of the symbolic link is to be written. The value of the symbolic link is actually the pathname that was specified when the symbolic link was created. The buffer must reside in the process's address space.
The name of a fullword in which the readlink service returns a count of the number of characters placed in the buffer, if the request is successful; or -1, if it is not successful.
Return_code | Explanation |
---|---|
EACCES | Search permission is denied for a component of the path prefix. |
EINVAL | The file named by Link_name is not a symbolic link; or there was a problem with the supplied buffer. The following reason codes can accompany the return code: JRFileNotSymLink, JRRdlBuffLenInvalid. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Link_name argument. This error is issued if more than 24 symbolic links are detected in the resolution of Link_name. |
ENAMETOOLONG | Link_name is longer than 1023 characters; or some component of the link name is longer than 255 characters. Name truncation is not supported. |
ENOENT | No file with the name specified by Link_name was found. The following reason code can accompany the return code: JRFileNotThere. |
ENOTDIR | A component of the path prefix is not a directory. |
The name of a fullword in which the readlink service stores the reason code. The readlink service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
There are no restrictions on the use of the readlink service.
For an example using this callable service, see BPX1RDL (readlink) example.