[PATCH 2/6] Make fclose seek input file to right offset (bug 12724)
Joseph Myers
josmyers@redhat.com
Wed Jan 15 19:16:48 GMT 2025
On Wed, 15 Jan 2025, DJ Delorie wrote:
> Must undo any unused read-ahead in the main buffer. IO_SEEKOFF doesn't
> check for the dual buffer state so only undoes the ungetc buffer.
>
> Why can't this fix be in the IO_SEEKOFF logic? Doesn't this imply that
> IO_SEEKOFF is faulty?
I don't know why the interface is designed the way it is, but all of
ftell, ftello, ftello64, fgetpos and fgetpos64 work with the IO_SEEKOFF
interface as it is (i.e., making this adjustment in the caller).
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list