man.bsd.lv manual page server

Manual Page Search Parameters

RMDIR(2) System Calls Manual RMDIR(2)

rmdirremove a directory file

library “libc”

#include <unistd.h>

int
rmdir(const char *path);

() 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:

[]
Search permission is denied for a component of the path prefix, or write permission is denied on the directory containing the link to be removed.
[]
The directory to be removed is the mount point for a mounted file system.
[]
path points outside the process's allocated address space.
[]
The last component of the path is ‘.’.
[]
An I/O error occurred while deleting the directory entry or deallocating the inode.
[]
Too many symbolic links were encountered in translating the pathname.
[]
A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters.
[]
The named directory does not exist.
[]
A component of the path is not a directory.
[]
The named directory contains files other than ‘.’ and ‘..’ in it.
[]
The directory containing the directory to be removed is marked sticky, and neither the containing directory nor the directory to be removed are owned by the effective user ID.
[]
The directory entry to be removed resides on a read-only file system.

mkdir(2), unlink(2)

The rmdir() function conforms to IEEE Std 1003.1-1990 (“POSIX.1”).

The rmdir() function call appeared in 4.2BSD.

October 11, 2014 NetBSD-9.2