home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / dirent / rewinddir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-18  |  353 b   |  22 lines

  1. #include <dirent.h>
  2. #include <unistd.h>
  3. #include <errno.h>
  4. #include <syscall.h>
  5. #undef lseek
  6.  
  7. static inline
  8.  _syscall3(off_t,lseek,int,fildes,off_t,offset,int,origin)
  9.  
  10. /*
  11.  * rewinddir() just does an lseek(fd,0,0) - see close for comments
  12.  */
  13. void
  14. rewinddir(DIR * dir)
  15. {
  16.   if (!dir) {
  17.     errno = EBADF;
  18.     return;
  19.   }
  20.   lseek(dir->dd_fd,0,SEEK_SET);
  21. }
  22.