seekdir.c 247 B

1234567891011121314
  1. #include <errno.h>
  2. #include <unistd.h>
  3. #include "dirstream.h"
  4. void seekdir(DIR * dir, off_t offset)
  5. {
  6. if (!dir) {
  7. __set_errno(EBADF);
  8. return;
  9. }
  10. dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET);
  11. dir->dd_size = dir->dd_nextloc = 0;
  12. }