Re: [PATCH] newlib: fix fseek optimization with SEEK_CUR

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Hi Bastien,

On Nov  9 17:28, Bastien Bouclet wrote:
> The call to fflush was invalidating the read buffer, preventing relative
> seeks to positions that would have been inside the read buffer from
> being optimized. The call to srefill would then re-read mostly the same
> data that was initially in the read buffer.

I checked this against upstream BSD versions.  OpenBSD and NetBSD
operate like our code, including the flush, while FreeBSD uses its
internal ftello and never flushed since the repository import back in
1994.

I'm pretty unsure if we can do this.  Apparently the flush op is only
necessary for streams in append mode.  If at all.

Can we be sure this works as desired on append streams as well?

Also, given that this is changing very basic code, nobody is unaffected.
Any input from other folks?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl3L18AACgkQ9TYGna5E
T6BYOA/+KdxLoh89ztaUVmg2IqM3AT4ipQ1eW1EMJD4Y26lTb8A2mltQz4tXpKQZ
jllJ0SO8IXCzpXmQomCycU45Hz+ARmiYX7s+LZujD+fWn06RB5CgZzhpXqqNNDAG
9TpH1H3jxtJpLgc2b+gCr7Lcip9MwywPlQGkuNdHF6ml7/vX/fLIMAg4KZXSNWmN
JPzVNb5MThjZZQ+rsgagxPo64I2TTR2jwxvhZ90YLuGz3ofhRl82fUwU9SR1668j
5To/TjsQFD/bwf3DhaSuvguKXUUKsdkPBr6dIKAUqmIwCT+LCcsHGmzjB6LJtzeb
l9qW4Ws01rDd1PGuWJlsqrVcErqa7qR2xBN8SI+v60A1FcOmsMM0m1yUJAnUTaUm
eTm9sArm99/abnNQyxm9I7Jd6a2qhKYU8D6WJVYzfgwTIkW38xlWyQlhmLhtacn7
HjB7cWtiDQkFufmQO71k/OmPwEzGG67hqjRqP+bKjDuBP7WW1VJf4Kyr1lbNXqoK
3xfBiJ+AQFtxUCiUNLNfLRuzKnrqZfl7CXuQ8uBOaIu3+tFaVtJY3/1UB/UPOte6
flzm4p4iCtnYjaOFVX1iuQkKKOUpgOdXfKKuAY9fY3xp+HsvrIp6GiBKlBQqsteo
UBTlo9e7QQBXcTEvWsD1aFFkqdZ1KXFMH9eljhAF3iOdiHFZmwA=
=r9jb
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.