1RMDIR(2) System Calls Manual RMDIR(2)
2
3
4
6 rmdir - remove a directory file
7
9 rmdir(path)
10 char *path;
11
13 Rmdir removes a directory file whose name is given by path. The direc‐
14 tory must not have any entries other than “.” and “..”.
15
17 A 0 is returned if the remove succeeds; otherwise a -1 is returned and
18 an error code is stored in the global location errno.
19
21 The named file is removed unless one or more of the following are true:
22
23 [ENOTDIR] A component of the path is not a directory.
24
25 [EINVAL] The pathname contains a character with the high-order
26 bit set.
27
28 [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
29 entire path name exceeded 1023 characters.
30
31 [ENOENT] The named directory does not exist.
32
33 [ELOOP] Too many symbolic links were encountered in translating
34 the pathname.
35
36 [ENOTEMPTY] The named directory contains files other than ``.'' and
37 ``..'' in it.
38
39 [EACCES] Search permission is denied for a component of the path
40 prefix.
41
42 [EACCES] Write permission is denied on the directory containing
43 the link to be removed.
44
45 [EPERM] The directory containing the directory to be removed is
46 marked sticky, and neither the containing directory nor
47 the directory to be removed are owned by the effective
48 user ID.
49
50 [EBUSY] The directory to be removed is the mount point for a
51 mounted file system.
52
53 [EIO] An I/O error occurred while deleting the directory entry
54 or deallocating the inode.
55
56 [EROFS] The directory entry to be removed resides on a read-only
57 file system.
58
59 [EFAULT] Path points outside the process's allocated address
60 space.
61
63 mkdir(2), unlink(2)
64
65
66
674.2 Berkeley Distribution August 26, 1985 RMDIR(2)