Buglet in fseek?

Corinna Vinschen vinschen@redhat.com
Tue Feb 21 09:57:00 GMT 2006


On Feb 20 18:27, Jeff Johnston wrote:
> Corinna Vinschen wrote:
> >On Feb 20 11:44, Jeff Johnston wrote:
> >
> >>Regarding your other note, we could make my initial solution simpler. 
> >>fflush() on a read-only stream sets the _SNPT flag on and fseek() clears 
> >>it appropriately after doing the lseek.  This solves the problem and 
> >>doesn't care about what is done in-between.  If you fflush() a read-only 
> >>stream, then the next fseek()/rewind() you do will be unoptimized.  I 
> >>think that is fair.
> >
> >Yep, that sounds good to me.
> 
> Alright, I have checked in the attached patch.  I debugged the two 
> scenarios to verify it was optimizing without the flush and not 
> optimizing with the flush.

Cool, that works nicely.


Thank you,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat



More information about the Newlib mailing list