The opendir callable service opens a directory so that it can be read with the readdir service.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1OPD): | 31-bit |
AMODE (BPX4OPD): | 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 BPX4OPD with the same parameters.
The name of a fullword that contains the length of the name of the directory.
The name of a field that contains the name of the directory. The length of this field is specified in Directory_name_length.
The name of a fullword in which the opendir service stores a directory file descriptor that describes the specified directory, if the request is successful; or -1, if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The process does not have permission to search some component of the name that is specified as Directory_name; or it does not have permission to work with the directory itself. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Directory_name argument. This error is issued if more than 24 symbolic links are detected in the resolution of Directory_name. |
EMFILE | Too many other files are already open for the process. |
ENAMETOOLONG | Directory_name is longer than 1023 bytes; or a component of the pathname is more than 255 bytes long. |
ENFILE | Too many files are already open. |
ENOENT | The specified directory was not found. The following reason codes can accompany the return code: JROpenDirNotFound and JRQuiescing. |
ENOTDIR | Some component of the pathname is not a directory. The following reason code can accompany the return code: JRTargetNotDir. |
The name of a fullword in which the opendir service stores the reason code. The opendir 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 opendir service.
For an example using this callable service, see BPX1OPD (opendir) example.