new directory with
The argument mode specifies the initial mode of
the new directory.
The protection bits of the argument mode are
modified by the process file mode creation mask (see
The value of the argument mode should be the
of the values of the desired permissions:
Execute (search) by owner
Read by owner
Read by group
Read by others (that is, anyone else)
Write by group
Write by others
Write by owner
Execute (search) by group
Execute (search) by others
The directory's owner ID is set to
the process's effective user ID.
The directory's group ID is set to the
process's effective group ID.
The newly created directory is empty
with the possible exception
of entries for ``.''
and ``..'' .
fails and no directory is
created if one or more of the following
a component of the
denies search permission,
or write permission is
denied on the parent
directory of the directory
to be created.
The named file
points outside the allocated address space of the process.
An I/O error has occurred while accessing the file system.
The maximum number of links to the parent directory would be exceeded.
Components of path require hopping to multiple
1. A component of the path prefix does not exist.
2. The path is longer than the maximum allowed.
points to a remote machine and the link to that
machine is no longer active.
A component of
is not a directory.
The path prefix resides
on a read-only file system.
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned, and
is set to indicate the error.
mkdir is conformant with:
X/Open Portability Guide, Issue 3, 1989
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
NIST FIPS 151-1