| RMDIR(2) | System Calls Manual | RMDIR(2) |
rmdir — remove a
directory file
Standard C Library (libc, -lc)
#include
<unistd.h>
int
rmdir(const
char *path);
rmdir()
removes a directory file whose name is given by path.
The directory must not have any entries other than
‘.’ and
‘..’.
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
The named file is removed unless:
EACCES]EBUSY]EFAULT]EINVAL].’.EIO]ELOOP]ENAMETOOLONG]NAME_MAX}
characters, or an entire path name exceeded
{PATH_MAX} characters.ENOENT]ENOTDIR]ENOTEMPTY].’ and
‘..’ in it.EPERM]EROFS]The rmdir() function conforms to
IEEE Std 1003.1-1990 (“POSIX.1”).
The rmdir() function call appeared in
4.2BSD.
| October 11, 2014 | NetBSD 11.0 |