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