.TH closedir() "" "" "General Function (libc)"
.PC "Close a directory stream"
.B "#include <dirent.h>"
\fBint closedir(\fIdirp\fB)\fR
\fBDIR *\fIdirp\fB;\fR
.PP
The \*(CO function
.B closedir()
is one of a set of \*(CO routines that manipulate directories in a
device-independent manner.
It closes the directory stream pointed to by
.IR dirp .
.PP
.B closedir()
returns zero if no error occurs.
If something goes wrong, it returns \-1 and sets
.B errno
to an appropriate value.
.SH Example
For an example of this system call, see the Lexicon entry for
.BR opendir() .
.SH "See Also"
.Xr "dirent.h," dirent.h
.Xr "getdents()," getdents
.Xr "libc," libc
.Xr "opendir()," opendir
.Xr "readdir()," readdir
.Xr "rewinddir()," rewinddir
.Xr "seekdir()," seekdir
.Xr "telldir()" telldir
.br
\*(PX Standard, \(sc5.1.2
.SH Notes
.II "Gwynn, D."
The \*(CO implementation of the \fBdirent\fR routines
was written by D. Gwynn.
