Commit | Line | Data |
---|---|---|
ef41f5fd KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
fd690c8b | 5 | .\" @(#)rmdir.2 6.3 (Berkeley) %G% |
ef41f5fd | 6 | .\" |
ff60b4cf | 7 | .TH RMDIR 2 "" |
ef41f5fd KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | rmdir \- remove a directory file | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .ft B | |
14 | rmdir(path) | |
15 | char *path; | |
16 | .fi | |
17 | .ft R | |
18 | .SH DESCRIPTION | |
19 | .I Rmdir | |
20 | removes a directory file | |
21 | whose name is given by | |
22 | .I path. | |
23 | The directory must not have any entries other | |
24 | than \*(lq.\*(rq and \*(lq..\*(rq. | |
25 | .SH "RETURN VALUE | |
26 | A 0 is returned if the remove succeeds; otherwise a \-1 is | |
27 | returned and an error code is stored in the global location \fIerrno\fP\|. | |
28 | .SH ERRORS | |
29 | The named file is removed unless one or more of the | |
30 | following are true: | |
31 | .TP 15 | |
b5984ffe KM |
32 | [ENOTDIR] |
33 | A component of the path is not a directory. | |
ef41f5fd | 34 | .TP 15 |
b5984ffe | 35 | [EINVAL] |
ef41f5fd KM |
36 | The pathname contains a character with the high-order bit set. |
37 | .TP 15 | |
b5984ffe KM |
38 | [ENAMETOOLONG] |
39 | A component of a pathname exceeded 255 characters, | |
40 | or an entire path name exceeded 1023 characters. | |
41 | .TP 15 | |
ef41f5fd | 42 | [ENOENT] |
b5984ffe | 43 | The named directory does not exist. |
ef41f5fd | 44 | .TP 15 |
b5984ffe KM |
45 | [ELOOP] |
46 | Too many symbolic links were encountered in translating the pathname. | |
ef41f5fd | 47 | .TP 15 |
b5984ffe KM |
48 | [ENOTEMPTY] |
49 | The named directory contains files other than ``.'' and ``..'' in it. | |
ef41f5fd KM |
50 | .TP 15 |
51 | [EACCES] | |
b5984ffe | 52 | Search permission is denied for a component of the path prefix. |
ef41f5fd KM |
53 | .TP 15 |
54 | [EACCES] | |
55 | Write permission is denied on the directory containing the link | |
56 | to be removed. | |
57 | .TP 15 | |
fd690c8b KM |
58 | [EPERM] |
59 | The directory containing the directory to be removed is marked sticky, | |
60 | and neither the containing directory nor the directory to be removed | |
61 | are owned by the effective user ID. | |
62 | .TP 15 | |
ef41f5fd KM |
63 | [EBUSY] |
64 | The directory to be removed is the mount point | |
65 | for a mounted file system. | |
66 | .TP 15 | |
b5984ffe KM |
67 | [EIO] |
68 | An I/O error occurred while deleting the directory entry | |
69 | or deallocating the inode. | |
70 | .TP 15 | |
ef41f5fd KM |
71 | [EROFS] |
72 | The directory entry to be removed resides on a read-only file system. | |
73 | .TP 15 | |
74 | [EFAULT] | |
75 | .I Path | |
76 | points outside the process's allocated address space. | |
ef41f5fd KM |
77 | .SH "SEE ALSO" |
78 | mkdir(2), unlink(2) |