/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:closedir.c 12.0$ */
/* $ACIS:closedir.c 12.0$ */
/* $Source: /ibm/acis/usr/src/lib/libc/gen/RCS/closedir.c,v $ */

#ifndef lint
static char *rcsid = "$Header:closedir.c 12.0$";
#endif

#include <sys/nfs_defines.h>

/*
 * Copyright (c) 1983 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)closedir.c	5.2 (Berkeley) 3/9/86";
#endif LIBC_SCCS and not lint

#ifdef VFS
/* @(#)closedir.c	1.2 87/07/22 3.2/4.3NFSSRC */
#endif VFS

#include <sys/param.h>
#include <sys/dir.h>

/*
 * close a directory.
 */
void
closedir(dirp)
	register DIR *dirp;
{
	close(dirp->dd_fd);
	dirp->dd_fd = -1;
	dirp->dd_loc = 0;
#ifdef VFS
	free(dirp->dd_buf);
#endif VFS
	free(dirp);
}
