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 / telldir.c < prev   
Encoding:
C/C++ Source or Header  |  1992-10-18  |  288 b   |  18 lines

  1. #include <dirent.h>
  2. #include <unistd.h>
  3. #include <syscall.h>
  4. #include <errno.h>
  5. #undef lseek
  6.  
  7. static inline
  8.  _syscall3(off_t,lseek,int,fildes,off_t,offset,int,origin)
  9.  
  10. off_t telldir(DIR * dir)
  11. {
  12.   if (!dir) {
  13.     errno = EBADF;
  14.     return -1;
  15.   }
  16.   return lseek(dir->dd_fd,0,SEEK_CUR);
  17. }
  18.