closedir (BPX1CLD, BPX4CLD) — Close a directory

Function

The closedir callable service closes a directory.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1CLD): 31-bit
AMODE (BPX4CLD): 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.

Format

The syntax format is as follows:
CALL BPX1CLD,(Directory_file_descriptor,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4CLD with the same parameters.

Parameters

Directory_file_descriptor
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the directory file descriptor that was returned when the directory was opened.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the closedir service returns 0 if the request is successful, or -1 if it is not successful.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the closedir service stores the return code. The closedir service returns Return_code only if Return_value is -1. For a list of return code values, see Return codes (errnos) in z/OS UNIX System Services Messages and Codes. The closedir service can return one of the following values in the Return_code parameter:
Return_code Explanation
EBADF The Directory_file_descriptor parameter does not represent an open directory.
EINTR The service was interrupted by a signal while it was processing a closedir request. The directory may or may not be closed.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the closedir service stores the reason code. The closedir service returns Reason_code only if Return_value is -1. For a list of reason codes, see Reason codes in z/OS UNIX System Services Messages and Codes.

Related services

Characteristics and restrictions

There are no restrictions on the use of the closedir service.