tell.c 260 B

12345678910111213141516
  1. #define lseek __normal_lseek
  2. #include <errno.h>
  3. #include <unistd.h>
  4. #include <syscall.h>
  5. #undef lseek
  6. static inline
  7. _syscall3(off_t,lseek,int,fildes,off_t,offset,int,origin)
  8. off_t tell(int);
  9. off_t
  10. tell (int fildes)
  11. {
  12. return lseek (fildes, 0, SEEK_CUR);
  13. }