Requirements Catalog of LSB Core 3.1

Requirements for the function 'rmdir'
StandardIDDescription
SUSv3rmdir.01 The rmdir() function shall remove a directory whose name is given by path. The directory shall be removed only if it is an empty directory.
SUSv3rmdir.10 If the directory is the root directory or the current working directory of any process, it is unspecified whether the function succeeds, or whether it shall fail and set errno to [EBUSY].
SUSv3rmdir.02 If path names a symbolic link, then rmdir() shall fail and set errno to [ENOTDIR].
SUSv3rmdir.03 If the path argument refers to a path whose final component is either dot or dot-dot, rmdir() shall fail.
SUSv3rmdir.04 If the directory's link count becomes 0 and no process has the directory open, the space occupied by the directory shall be freed and the directory shall no longer be accessible.
SUSv3rmdir.05 If one or more processes have the directory open when the last link is removed, the dot and dot-dot entries, if present, shall be removed before rmdir() returns and no new entries may be created in the directory, but the directory shall not be removed until all references to the directory are closed
SUSv3rmdir.11 If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY].
SUSv3rmdir.06 Upon successful completion, the rmdir() function shall mark for update the st_ctime and st_mtime fields of the parent directory.
SUSv3rmdir.07 Upon successful completion, the function rmdir() shall return 0.
SUSv3rmdir.08 Otherwise, -1 shall be returned, and errno set to indicate the error. If -1 is returned, the named directory shall not be changed.
SUSv3rmdir.90 The rmdir() function shall fail if
SUSv3rmdir.90.01 [EACCES] Search permission is denied on a component of the path prefix, or write permission is denied on the parent directory of the directory to be removed.
SUSv3rmdir.90.02 [EBUSY] The directory to be removed is currently in use by the system or some process and the implementation considers this to be an error.
SUSv3rmdir.90.03 [EEXIST] or [ENOTEMPTY] The path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.
SUSv3rmdir.90.04 [EINVAL] The path argument contains a last component that is dot.
SUSv3rmdir.90.05 [EIO] A physical I/O error has occurred.
SUSv3rmdir.90.06 [ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
SUSv3rmdir.90.07 [ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
SUSv3rmdir.90.08 [ENOENT] A component of path does not name an existing file, or the path argument names a nonexistent directory or points to an empty string.
SUSv3rmdir.90.10 [ENOTDIR] A component of path is not a directory.
SUSv3rmdir.90.11 [EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the parent directory of the directory to be removed and the caller is not the owner of the directory to be removed, nor is the caller the owner of the parent directory, nor does the caller have the appropriate privileges.
SUSv3rmdir.90.12 [EROFS] The directory entry to be removed resides on a read-only file system.
SUSv3rmdir.91 The rmdir() function may fail if:
SUSv3rmdir.91.01 [ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
SUSv3rmdir.91.02 [ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
The text in the Description column of SUSv3 requirements is reproduced from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html