Mail Archives: djgpp-workers/2000/12/13/20:58:07
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.
<filelength stuff snipped>
>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)
- Raw text -