int mkdir(path, mode) char *path; int mode;
#include <sys/types.h> #include <sys/stat.h>
int mkdir(path, mode) char *path; mode_t mode;
mkdir() creates a new directory file with name path. The mode mask of the new directory is initialized from mode.
The low-order 9 bits of mode (the file access permissions) are modified such that all bits set in the process's file mode creation mask are cleared (see umask.2v
The set-GID bit of mode is ignored. The set-GID bit of the new file is inherited from that of the parent directory.
The directory's owner ID is set to the process's effective user ID.
The directory's group ID is set to either:
Upon successful completion, mkdir() marks for update the st_atime, st_ctime, and st_mtime fields of the directory (see stat.2v The st_ctime and st_mtime fields of the directory's parent directory are also marked for update.
mkdir() returns:
mkdir() will fail and no directory will be created if:
Write permission is denied on the parent directory of the directory to be created.
The new directory cannot be created because the user's quota of disk blocks on the file system which will contain the directory has been exhausted.
The user's quota of inodes on the file system on which the file is being created has been exhausted.
A pathname component is longer than {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect (see pathconf.2v
The new directory cannot be created because there is no space left on the file system which will contain the directory.
There are no free inodes on the file system on which the file is being created.
In addition to the above, the following may also occur:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97