This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
fgetpos/ftello without system call
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-help <libc-help at sourceware dot org>
- Date: Fri, 1 Sep 2017 11:17:10 +0200
- Subject: fgetpos/ftello without system call
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 35FBFC29B5F1
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