Take the 2-minute tour ×

Can you please tell me where the off_t tell(int fd) function is defined in Mac OS X? It's not in fcntl.h and not in unistd.h, where it is defined in UNIX... I can't use ftell() because the code I'm porting works with file descriptors.

I'm using GCC v4.2.1

share|improve this question
Please don't [pseudotag] your question titles. That's what the tag list is for. –  razlebe Jun 1 '11 at 11:03
add comment

1 Answer

up vote 4 down vote accepted

You should be able to use lseek instead, which offers the same functionality:

off_t tell(int fd)
    return lseek(fd, 0, SEEK_CUR);
share|improve this answer
Man... I'm so stupid! Thanks, Greg! –  Ryan Jun 1 '11 at 10:24
@Ryan: I don't see how that's relevant –  sehe Jun 1 '11 at 11:29
add comment

Your Answer


