This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fgetpos/ftello without system call


Is it possible to obtain the current read offset of a stream without
triggering an lseek system call?

I know that nothing manipulates the underlying file descriptor directly.

The actual goal here is to read the same line multiple times using
fgets, enlarging the buffer if necessary.

It seems that libio maintains an _offset member in the underlying FILE
object, but never actually uses it for descriptor-based files (mapped
files are a different story).

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]