The mkdir callable service creates a new, empty directory.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1MKD): | 31-bit |
AMODE (BPX4MKD): | 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 BPX4MKD with the same parameters.
The name of a fullword that contains the length of the full Pathname of the directory. The name can be up to 1023 bytes long. Each component of the name (between delimiters) can be up to 255 bytes long.
The name of a field, of length Pathname_length, that contains the full name of the directory.
The name of a fullword in which the mode field is specified. The mode field specifies the file type and the permissions you grant to yourself, to your group, and to any user.
The file type is identified using the BPXYFTYP mapping macro and permissions that are specified with the BPXYMODE mapping macro. See BPXYFTYP — File type definitions and BPXYMODE — Map the mode constants of the file services.
The name of a fullword in which the mkdir service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The process did not have search permission on some component of Pathname, or did not have write permission on the parent directory of the directory to be created. |
EEXIST | There is already a file or directory with the given Pathname. The following reason code can accompany the return code: JRMkDirExist. |
EFBIG | A request to create a directory is prohibited because the file size limit for the process is set to 0. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Pathname argument. This error is issued if more than 24 symbolic links are detected in the resolution of Pathname. |
EMLINK | The link count of the parent directory has already reached the maximum defined for the system. Refer to the LINK_MAX in pathconf (BPX1PCF, BPX4PCF) — Determine configurable path name variables using a path name, or to fpathconf (BPX1FPC, BPX4FPC) — Determine configurable path name variables using a descriptor. |
ENAMETOOLONG | Pathname contains more than 1023 characters; or a component of the name is longer than 255 characters. |
ENOENT | Some component of Pathname does not exist; or the Pathname parameter is blank. |
ENOSPC | The file system does not have enough space to contain a new directory; or the parent directory cannot be extended. |
ENOTDIR | A component of Pathname is not a directory. |
EROFS | The parent directory of the directory to be created is on a read-only file system. The following reason code can accompany the return code: JRMkDirROnly. |
The name of a fullword in which the mkdir service stores the reason code. The mkdir service returns a Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
There are no restrictions on the use of the mkdir service.
For an example using this callable service, see BPX1MKD (mkdir) example.