1 /* $Id: closedir.c,v 1.4 2002/10/29 04:45:28 rex Exp $
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/dirent/closedir.c
7 * PURPOSE: Close a directory stream
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
11 * 13/02/2002: KJK::Hyperion: modified to use file descriptors
17 #include <sys/types.h>
18 #include <psx/dirent.h>
19 #include <psx/safeobj.h>
21 int closedir(DIR *dirp
)
23 /* check the "magic" signature */
24 if(!__safeobj_validate(dirp
, __IDIR_MAGIC
))
30 /* this will close the handle, deallocate the internal object and
31 invalidate the descriptor */
32 return (close(((struct __internal_DIR
*)dirp
)->fildes
));