. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / other / _seekdir.c
bloba341f9dc746fda504b30f48f07bc438a641ec559
1 /* seekdir() Author: Kees J. Bot
2 * 24 Apr 1989
3 */
4 #define nil 0
5 #include <lib.h>
6 #define lseek _lseek
7 #define readdir _readdir
8 #define seekdir _seekdir
9 #include <sys/types.h>
10 #include <dirent.h>
11 #include <unistd.h>
12 #include <errno.h>
14 int seekdir(DIR *dp, off_t pos)
15 /* Seek to position pos in a directory. */
17 int off;
19 if (dp == nil) { errno= EBADF; return -1; }
21 dp->_count= 0;
23 if (lseek(dp->_fd, pos, SEEK_SET) == -1) return -1;
25 return 0;