The getwd 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 (BPX1GWD): | 31-bit |
AMODE (BPX4GWD): | 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 BPX4GWD with the same parameters.
The name of a fullword that contains the length of the buffer to which the getwd 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). Length of zero has special meaning; see the usage notes.
The name of the buffer that will hold the pathname of the working directory.
The name of a fullword in which the getwd 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 | The Buffer_length specified was not valid. 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 is 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 specified Buffer_length is zero, and the length of the pathname of the working directory is larger than PATH_MAX bytes. |
The name of a fullword in which the getwd service stores the reason code. The getwd 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 getwd service.
For an example using this callable service, see BPX1GWD (getwd) example.