开发者

Where is the tell() function defined?

开发者 https://www.devze.com 2023-03-09 13:53 出处:网络
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

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 portin开发者_Go百科g works with file descriptors.

I'm using GCC v4.2.1


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

off_t tell(int fd)
{
    return lseek(fd, 0, SEEK_CUR);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消