Open System Services System Calls Reference Manual (G06.28+, H06.05+)

System Functions (k - m) mkdir(2)
NAME
mkdir - Creates a directory
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <sys/stat.h>
int mkdir(
const char *path,
mode_t mode);
PARAMETERS
path Points to the pathname for the new directory.
If any component of the path parameter refers to a symbolic link, the link is
traversed and pathname resolution continues.
If the nal component of the path parameter refers to an existing entity, the call
fails and errno is set to [EEXIST].
mode Species the mask for the read, write, and search/execute (RWX) ags for
owner, group, and others. Also species the le type ags for the directory.
The value of this parameter is constructed by logically ORing ags that are |
dened in the sys/stat.h header le. The permission bits are affected by the |
value of this parameter but depend on both the support for OSS ACLs on the sys- |
tem on which this process is running and on the leset that contains the new |
directory. See "ACL Inheritance" in the acl(5) reference page.
The le type ags are described in DESCRIPTION.
DESCRIPTION
The mkdir() function creates a new directory with the following attributes:
The owner ID is set to the effective user ID of the calling process. Directories within /G
(the Guardian le system) are the exception; for them, the owner ID is set to 65535 (the
super ID).
The group ID is set to the group ID of the parent directory if the S_ISGID ag is set in
the parent directory; otherwise, the group ID is set to the effective group ID of the calling
process. Directories within /G (the Guardian le system) are the exception; for them, the
group ID is set to 255.
The value of the mode parameter is constructed by logically ORing ags that are dened |
in the sys/stat.h header le. |
If the parent directory of the created le does not have default OSS access control list |
(ACL) entries, the permissions for the new le are the bit-wise AND of this mode param- |
eter with the complement of the process umask (see the umask(2) reference page). If the |
parent directory of the created le has default ACL entries, the permissions for the new |
le are affected by the value of this parameter but depend on both the support for OSS |
ACLs on the system on which this process is running and on the leset that contains the |
new directory. See "ACL Inheritance" in the acl(5) reference page.
Directories within /G (the Guardian le system) are the exception; for them, all the
527186-007 Hewlett-Packard Company 449