. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / posix / _closedir.c
blob50fcec2812ff90e3b06c75ef7db5aecacd1c5481
1 /* closedir() Author: Kees J. Bot
2 * 24 Apr 1989
3 */
4 #define nil 0
5 #include <lib.h>
6 #define close _close
7 #define closedir _closedir
8 #include <sys/types.h>
9 #include <dirent.h>
10 #include <unistd.h>
11 #include <stdlib.h>
12 #include <errno.h>
14 int closedir(DIR *dp)
15 /* Finish reading a directory. */
17 int d;
19 if (dp == nil) { errno= EBADF; return -1; }
21 d= dp->_fd;
22 free((void *) dp);
23 return close(d);