telldir.c 271 B

12345678910111213141516
  1. /* $Id$ */
  2. #include <sys/types.h>
  3. #include <sys/dir.h>
  4. /*
  5. * return a pointer into a directory
  6. */
  7. long telldir(dirp)
  8. DIR *dirp;
  9. {
  10. extern long lseek();
  11. if (dirp->dd_fd >= 0)
  12. return (lseek(dirp->dd_fd, 0L, 1) - dirp->dd_size + dirp->dd_loc);
  13. return dirp->dd_loc;
  14. }