Requirements Catalog of LSB Core 3.1

Requirements for the function 'mkdir'
StandardIDDescription
SUSv3mkdir.01 The mkdir() function shall create a new directory with name path.
SUSv3mkdir.02 The file permission bits of the new directory shall be initialized from mode.
SUSv3mkdir.03 These file permission bits of the mode argument shall be modified by the process' file creation mask
SUSv3mkdir.04 The directory's user ID shall be set to the process' effective user ID
SUSv3mkdir.05 The directory's group ID shall be set to the group ID of the parent directory or to the effective group ID of the process. Implementations shall provide a way to initialize the directory's group ID to the group ID of the parent directory. Implementations may, but need not, provide an implementation-defined way to initialize the directory's group ID to the effective group ID of the calling process.
SUSv3mkdir.06 The newly created directory shall be an empty directory.
SUSv3mkdir.07 If path names a symbolic link, mkdir() shall fail and set errno to [EEXIST].
SUSv3mkdir.08 Upon successful completion, mkdir() shall mark for update the st_atime, st_ctime, and st_mtime fields of the directory.
SUSv3mkdir.09 Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update.
SUSv3mkdir.10 Upon successful completion, mkdir() shall return 0.
SUSv3mkdir.11 Otherwise, -1 shall be returned, no directory shall be created, and errno shall be set to indicate the error
SUSv3mkdir.12 The mkdir() function shall fail if:
SUSv3mkdir.12.01 [EACCES] Search permission is denied on a component of the path prefix, or write permission is denied on the parent directory of the directory to be created.
SUSv3mkdir.12.02 [EEXIST] The named file exists.
SUSv3mkdir.12.03 [ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
SUSv3mkdir.12.04 [EMLINK] The link count of the parent directory would exceed {LINK_MAX}.
SUSv3mkdir.12.05 [ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
SUSv3mkdir.12.06 [ENOENT] A component of the path prefix specified by path does not name an existing directory or path is an empty string.
SUSv3mkdir.12.07 [ENOSPC] The file system does not contain enough space to hold the contents of the new directory or to extend the parent directory of the new directory.
SUSv3mkdir.12.08 [ENOTDIR] A component of the path prefix is not a directory.
SUSv3mkdir.12.09 [EROFS] The parent directory resides on a read-only file system.
SUSv3mkdir.13 The mkdir() function may fail if:
SUSv3mkdir.13.01 [ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
SUSv3mkdir.13.02 [ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
The text in the Description column of SUSv3 requirements is reproduced from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html