Mail Archives: djgpp-workers/2001/10/12/03:45:50
Richard said:
> Martin Stromberg wrote:
> > Richard said:
> [snip]
> > > off_t does not allow us to handle the full extent of files > 2GB in
> > > size, because off_t is too small right now. Hence this thread.
> >
> > No. You don't get it. It the same exercise again. You pass in the
> > negative number and it doesn't matter. It will seek to the right
> > place.
>
> I'm not convinced by your argument. Consider relative seeks:
>
> lseek(fd, SEEK_SET, 2GB - 10);
> lseek(fd, SEEK_CUR, 1GB);
>
> Now I want to seek backwards 2.5GB. How would I do that? How does lseek
lseek(fd, SEEK_CUR, -2.5GB) (or lseek(fd, SEEK_CUR, -2.5GB + 2^32),
it's the same thing).
> know which direction I want to go for relative seeks with |offset| > 2GB?
It doesn't and doesn't need to as everything is done mod 2^32. _Or_
perhaps it does and acts differently depending on current position and
seek offset.
> Incidentally, why does lseek check whether the file descriptor is a pipe
> or not, after it's done the INT21h call? Shouldn't it do it before the
> interrupt?
Don't know.
Right,
MartinS
- Raw text -