Date: Fri, 19 Jan 2001 18:09:58 -0500 Message-Id: <200101192309.SAA17874@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f From: DJ Delorie To: djgpp-workers AT delorie DOT com In-reply-to: <3A687DD7.834.3F21A6@localhost> (snowball3@bigfoot.com) Subject: Re: Where does gcc -o foo make foo.exe References: <3A605A7C DOT 44 DOT 7AB95C AT localhost> <3A687DD7 DOT 834 DOT 3F21A6 AT localhost> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > I've gone over the binutils archives (used 'fseek zero' as search term) and > found that two other tries at a generic fix failed and the opinion was the > seek/garbage problem should not be solved in the libc library and not BFD. So > I don't think any patch I offer will be accepted. I think it would be better > to solve the problem in our own libc and available by means of some flag. I solved it in cygwin pretty easily, but it depends on having a flag available for each open file descriptor. The algorithm is: * When you seek, set a flag. * When you write, if the flag is set, reset flag and see if you're past EOF. * If you are past EOF, write zeros to fill the gap. You don't want to do the "see if you're past EOF" part on *every* write, just the ones that follow seeks.