xref: /csrg-svn/lib/libc/gen/closedir.c (revision 26544)
121339Sdist /*
221339Sdist  * Copyright (c) 1983 Regents of the University of California.
321339Sdist  * All rights reserved.  The Berkeley software License Agreement
421339Sdist  * specifies the terms and conditions for redistribution.
521339Sdist  */
621339Sdist 
7*26544Sdonn #if defined(LIBC_SCCS) && !defined(lint)
8*26544Sdonn static char sccsid[] = "@(#)closedir.c	5.2 (Berkeley) 03/09/86";
9*26544Sdonn #endif LIBC_SCCS and not lint
105749Smckusick 
116370Smckusic #include <sys/param.h>
1213582Ssam #include <sys/dir.h>
135749Smckusick 
145749Smckusick /*
155749Smckusick  * close a directory.
165749Smckusick  */
175749Smckusick void
185749Smckusick closedir(dirp)
196098Smckusic 	register DIR *dirp;
205749Smckusick {
215749Smckusick 	close(dirp->dd_fd);
226098Smckusic 	dirp->dd_fd = -1;
236098Smckusic 	dirp->dd_loc = 0;
245749Smckusick 	free(dirp);
255749Smckusick }
26