Message-Id: <5.0.2.1.0.20001213204815.025a7ec0@pop5.banet.net> X-Sender: usbanet DOT farley3 AT pop5 DOT banet DOT net X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Wed, 13 Dec 2000 20:59:09 -0500 To: Eli Zaretskii From: "Peter J. Farley III" Subject: Re: Locking fcntl changes #2 Cc: djgpp-workers AT delorie DOT com In-Reply-To: References: <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20001212231952 DOT 025d8780 AT pop5 DOT banet DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 At 01:20 PM 12/13/00 +0200, Eli Zaretskii wrote: >On Tue, 12 Dec 2000, Peter J. Farley III wrote: >> I researched the question of a zero length to int21/5C. RBIL is >> silent on the allowed values. I will have to try setting the current >> position past EOF and then try locking to check the negative case, >> and setting it at EOF and try locking to check the zero case. > >You could make it part of the test program; that way, if something >changes in some future versions of DOS/Windows, we'd know. That's what I had in mind. It's in progress. >So I think it would be easier for you to dump filelength and use >llseek in all cases, including the FAT16 branch. In other words, >expand filelength's guts inline and replace lseek with llseek. Or just change filelength to use llseek. Isn't that a better solution? Of course, if the definition of filelength insists on a long result, wrong results can still be returned. If that's the case, what about an "l" version of filelength (though "lfilelength" seems a bit of a cumbersome name, IMHO) which returns a long long? >> len = (unsigned long)filelength(fd) - cur_pos; > >I think this is unsafe because filelength uses lseek, which is >dangerous on FAT32 volumes. Unless filelength uses llseek, of course. Or unless we use lfilelength, which would of course use llseek. --------------------------------------------------------- Peter J. Farley III (pjfarley AT dorsai DOT org OR pjfarley AT banet DOT net)