[PATCH v2] ftell: seek to end only when there are unflushed bytes (BZ #17647)

Rich Felker dalias@libc.org
Tue Nov 25 20:14:00 GMT 2014


On Tue, Nov 25, 2014 at 09:24:04PM +0530, Siddhesh Poyarekar wrote:
> Upon re-reading the standard, it seems like the intervening
> fseek/fflush should not be required since ftruncate does not change
> the file offset.  So this is a bug and here's an updated patch:

I haven't read these patches in detail, but are you sure this matters?
I think the "active handle" rules forbid truncating a file while a
stdio stream is the active handle, but I may be mistaken.

Rich



More information about the Libc-alpha mailing list