sys_rmdir  [fs/namei.c]


Deletes a directory.

Arguments

eax 40
ebx Pointer to a null-terminated string specifying the pathname of a directory to delete. The directory must be empty.

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 Write access to the directory containing pathname was not allowed, or one of the directories in the path prefix of pathname did not allow search permission.
-EBUSY Pathname is currently used as a mount point or is the root directory of the calling process.
-EFAULT ebx outside your accessible address space.
-EINVAL Pathname has . as last component.
-ELOOP Too many symbolic links were encountered in resolving pathname.
-ENAMETOOLONG Pathname was too long.
-ENOENT A directory component in pathname does not exist or is a dangling symbolic link.
-ENOMEM Insufficient kernel memory was available.
-ENOTDIR Pathname, or a component used as a directory in pathname, is not, in fact, a directory.
-ENOTEMPTY Pathname contains entries other than . and .. ; or, pathname has .. as its final component.
-EPERM The directory containing pathname has the sticky bit (S_ISVTX) set and the process's effective user ID is neither the user ID of the file to be deleted nor that of the directory containing it, and the process is not privileged (does not have the CAP_FOWNER capability).
-or-
The filesystem containing pathname does not support the removal of directories.
-EROFS Pathname refers to a file on a read-only filesystem.

Remarks

Infelicities in the protocol underlying NFS can cause the unexpected disappearance of directories which are still being used.

Compatibility

n/a