sys_mkdir  [fs/namei.c]


Creates a directory.

The newly created directory will be owned by the effective user ID of the process. If the directory containing the file has the set-group-ID bit set, or if the filesystem is mounted with BSD group semantics, the new directory will inherit the group ownership from its parent; otherwise it will be owned by the effective group ID of the process.

If the parent directory has the set-group-ID bit set then so will the newly created directory.

This system call is identical to sys_mkdirat with ebx set to AT_FDCWD.

Arguments

eax 39
ebx Pointer to a null-terminated string that specifies the pathname of the directory to be created.
ecx Directory access permissions. All the file permission bits are set to the bits of ecx except for those set in the file-mode creation mask of the process. (See sys_umask). Available permissions are:
S_ISUID  - set user ID on execution
S_ISGID  - set group ID on execution
S_ISVTX  - on directories, restricted deletion flag
S_IRWXU  - owner has read, write and execute permission
S_IRUSR  - owner has read permission
S_IWUSR  - owner has write permission
S_IXUSR  - owner has execute permission
S_IRWXG  - group has read, write and execute permission
S_IRGRP  - group has read permission
S_IWGRP  - group has write permission
S_IXGRP  - group has execute permission
S_IRWXO  - others have read, write and execute permission
S_IROTH  - others have read permission
S_IWOTH  - others have write permission
S_IXOTH  - others have execute permission

Return values

If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:

-EACCES The parent directory does not allow write permission to the process, or one of the directories in the path pointed by ebx did not allow search permission.
-EEXIST Path pointed by ebx already exists (not necessarily as a directory). This includes the case where path is a symbolic link, dangling or not.
-EFAULT ebx points outside your accessible address space.
-ELOOP Too many symbolic links were encountered in resolving the path pointed by ebx.
-ENAMETOOLONG Path pointed by ebx was too long.
-ENOENT A directory component in the path pointed by ebx does not exist or is a dangling symbolic link.
-ENOMEM Insufficient kernel memory was available.
-ENOSPC The device containingthe path pointed by ebx has no room for the new directory.
-or-
The new directory cannot be created because the user's disk quota is exhausted.
-ENOTDIR A component used as a directory in the path pointed by ebx is not, in fact, a directory.
-EPERM The filesystem containing the path pointed by ebx does not support the creation of directories.
-EROFS Path pointed by ebx refers to a file on a read-only filesystem.

Remarks

n/a

Compatibility

n/a