The access callable service determines whether the caller can access a file. You identify the file by its pathname.
Operation | Authorization |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1ACC): | 31-bit |
AMODE (BPX4ACC): | 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 BPX4ACC with the same parameters.
The name of a fullword that contains the length of the pathname of the file.
The name of a field that contains the pathname of the file to be checked for accessibility. The length of this field is specified in Pathname_length.
The name of a fullword in which the access service returns 0 if the request completes successfully (that is, the file exists or access is permitted), or -1 if the request is not successful, or the file cannot be accessed in the specified way.
Return_code | Explanation |
---|---|
EACCES | The calling process does not have appropriate permissions to access the file in the ways specified by the Access_Mode parameter, or does not have search permission for some component of the Pathname prefix. |
EINVAL | The Access_Mode parameter is incorrect. The following reason code unique to the access service can accompany the return code: JRInvalidAMODE. |
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 some component of the 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 unique to the access service can accompany the return code: JRFileNotThere. |
ENOTDIR | A component of the Pathname prefix is not a directory. |
EROFS | The Access_Mode parameter is testing for write access to a read-only file system. The following reason code unique to the access service can accompany the return code: JRReadOnlyFS. |
The name of a fullword where the access service stores the reason code. The access service returns 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 access service.
For an example using this callable service, see BPX1ACC (access) example.