The rewinddir callable service "rewinds," or resets, to the beginning of, an open directory. The next call to the readdir service reads the first entry in the directory.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RWD): | 31-bit |
AMODE (BPX4RWD): | 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 BPX4RWD with the same parameters.
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 in which the rewinddir service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EBADF | The Directory_file_descriptor parameter does not represent an open directory. The following reason code can accompany the return code: JRRwdFileNotDir. |
The name of a fullword in which the rewinddir service stores the reason code. The rewinddir 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.
If the contents of the directory that you specify have changed since the directory was opened, a call to the rewinddir service resets the pointer into the directory to the beginning. A subsequent call to the readdir service reads from the start of the directory and obtains the new contents.
There are no restrictions on the use of the rewinddir service.
For an example using this callable service, see BPX1RWD (rewinddir) example.