The readdir callable service reads multiple name entries from a directory.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RDD): | 31-bit |
AMODE (BPX4RDD): | 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 BPX4RDD with the same parameters. The Buffer_address parameter is a doubleword.
The name of a fullword that contains the directory file descriptor that was returned when the directory was opened (see opendir (BPX1OPD, BPX4OPD) — Open a directory).
The name of a fullword (doubleword) that contains the address of the buffer in which readdir is to write the directory entries. This address must be supplied to the readdir call. The directory entries are mapped by the BPXYDIRE macro; see BPXYDIRE — Map directory entries for readdir.
The name of a fullword that contains the ALET for the Buffer_address that identifies the address space or data space where the buffer resides.
You should specify a Buffer_ALET of 0 for the normal case of a buffer in the user's address space (current primary address space). If a value other than 0 is specified for the Buffer_ALET, the value must represent a valid entry in the dispatchable unit access list (DUAL).
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 in which the readdir service returns the number of directory entries that have been read into the buffer, or -1 if it is unsuccessful. A value of 0 in Return_value indicates the end of the directory.
Return code | Explanation |
---|---|
EBADF | The Directory_file_descriptor argument does not refer to an open directory. |
EINVAL | The buffer is too small to contain any entries. |
The name of a fullword in which the readdir service stores the reason code. The readdir 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 readdir service.
For an example using this callable service, see BPX1RDD (readdir) example.