From 8bdc62b0890760ebe6ddd70f2841b5136fbf7cb0 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 19 Mar 2001 22:49:36 +0000 Subject: Move the dirent stuff. I suppose it is system dependant, but then it really should be grouped together too. And it needed to be grouped more then it needed to be in sysdeps/linux/common --- libc/misc/dirent/rewinddir.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libc/misc/dirent/rewinddir.c (limited to 'libc/misc/dirent/rewinddir.c') diff --git a/libc/misc/dirent/rewinddir.c b/libc/misc/dirent/rewinddir.c new file mode 100644 index 000000000..9d147fca2 --- /dev/null +++ b/libc/misc/dirent/rewinddir.c @@ -0,0 +1,15 @@ +#include +#include +#include "dirstream.h" + + +/* rewinddir() just does an lseek(fd,0,0) - see close for comments */ +void rewinddir(DIR * dir) +{ + if (!dir) { + errno = EBADF; + return; + } + lseek(dir->dd_fd, 0, SEEK_SET); + dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0; +} -- cgit v1.2.3