The getcwd callable service gets the pathname of the working directory.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GCW): | 31-bit |
AMODE (BPX4GCW): | 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 BPX4GCW with the same parameters.
The name of a fullword that contains the length of the buffer to which the getcwd service returns the pathname of the directory. Buffer_length must be large enough to accommodate the actual length of the pathname plus one (for the terminating null).
The name of the buffer that is to hold the pathname of the working directory.
The name of a fullword in which the getcwd service returns the length of the pathname that is in the buffer, if the request is successful; or -1, if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The process did not have permission to read or search a component of the working directory's pathname. |
EINVAL | Buffer_length was specified as zero. The following reason code can accompany the return code: JRBufLenInvalid. |
EIO | An input/output error occurred. |
ENOENT | A component of a pathname does not exist. This will be returned if a component of the working directory pathname was deleted. |
ERANGE | The specified Buffer_length is less than the length of the pathname of the working directory. |
The name of a fullword in which the getcwd service stores the reason code. The getcwd 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 getcwd service.
For an example using this callable service, see BPX1GCW (getcwd) example.