The mkdir() function creates a new directory named by the path name pointed to by path. The mode of the new directory is initialized from mode (see chmod(2) for values of mode). The protection part of the mode argument is modified by the process's file creation mask (see umask(2)).
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, or if the S_ISGID bit is set in the parent directory, then the group ID of the directory is inherited from the parent. The S_ISGID bit of the new directory is inherited from the parent directory.
If path is a symbolic link, it is not followed.
The newly created directory is empty with the exception of entries for itself (.) and its parent directory (..).
Upon successful completion, mkdir() marks for update the st_atime, st_ctime and st_mtime fields of the directory. Also, the st_ctime and st_mtime fields of the directory that contains
the new entry are marked for update.
|