This is the mail archive of the libc-alpha@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]

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


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

Attachment: pgpgbuR8Ab1jS.pgp
Description: PGP signature


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