telldir.c 365 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <dirent.h>
  7. #include <errno.h>
  8. #include <unistd.h>
  9. #include "dirstream.h"
  10. long int telldir(DIR * dir)
  11. {
  12. if (!dir) {
  13. __set_errno(EBADF);
  14. return -1;
  15. }
  16. /* The next entry. */
  17. return dir->dd_nextoff;
  18. }