[PATCH v2] Fix ftell with fdopen for all cases and fopen with a+ mode (#16532)

Siddhesh Poyarekar siddhesh@redhat.com
Thu Feb 20 02:03:00 GMT 2014


On Wed, Feb 19, 2014 at 01:35:02PM -0500, Rich Felker wrote:
> I'm not sure what you mean by this. Certainly at least some writes are
> required, e.g. obtaining the lock.

Of course, I meant modifying the offset (as opposed to just caching
it), modifying buffer pointers (for wide mode) and flushing.

> But I think you can still cache the offset as long as the FILE is
> currently reading or writing. One easy way to know you can cache the
> offset is when the buffer is non-empty, but there also seem to be
> some cases where you can cache it even when the buffer is empty; I'm
> not sure if it's worth optimizing for those too.

I meant that it is safer to start with an implementation with no
writes at all and then add cases where we can positively identify that
the handle is active and it does not change the state of the handle.

Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140220/31749af6/attachment.sig>


More information about the Libc-alpha mailing list