Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
mkdir(2) OSS System Calls Reference Manual
NAME
mkdir - Creates a directory
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-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 final component of the path parameter refers to an existing entity, the call
fails and errno is set to [EEXIST].
mode Specifies the mask for the read, write, and search/execute (RWX) flags for
owner, group, and others. Also specifies the file type flags for the directory.
The value of this parameter is constructed by logically ORing flags that are
defined in the sys/stat.h header file. 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 fileset that contains the new
directory. See "ACL Inheritance" in the acl(5) reference page.
The file type flags 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 file 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 flag 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 file system) are the exception; for them, the
group ID is set to 255.
• The value of the mode parameter is constructed by logically ORing flags that are defined
in the sys/stat.h header file.
If the parent directory of the created file does not have default OSS access control list
(ACL) entries, the permissions for the new file 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 file has default ACL entries, the permissions for the new
file 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 fileset that contains the
new directory. See "ACL Inheritance" in the acl(5) reference page.
Directories within /G (the Guardian file system) are the exception; for them, all the
4−48 Hewlett-Packard Company 527186-023