RMDIR(2) — SYSTEM CALLS
NAME
rmdir − remove a directory file
SYNOPSIS
rmdir(path)
char ∗path;
DESCRIPTION
rmdir removes a directory file whose name is given by path. The directory must not have any entries other than “.” and “..”.
RETURN VALUE
A 0 is returned if the remove succeeds; otherwise a −1 is returned and an error code is stored in the global location errno.
ERRORS
The named file is removed unless one or more of the following are true:
ENOTDIR A component of the path prefix of path is not a directory.
ENOTDIR The file referred to by path is not a directory.
EINVAL path contains a character with the high-order bit set.
ENAMETOOLONG
The length of a component of path exceeds 255 characters, or the length of path exceeds 1023 characters.
ENOENT The directory referred to by path does not exist.
ELOOP Too many symbolic links were encountered in translating path.
ENOTEMPTY The directory referred to by path contains files other than “.” and “..” in it.
EACCES Search permission is denied for a component of the path prefix of path.
EACCES Write permission is denied for the directory containing the link to be removed.
EBUSY The directory to be removed is the mount point for a mounted file system. EIO An I/O error occurred while reading from or writing to the file system.
EROFS The directory to be removed resides on a read-only file system.
EFAULT path points outside the process’s allocated address space.
SEE ALSO
Sun Release 3.2 — Last change: 16 July 1986