delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/02/03/12:09:32

Date: Wed, 3 Feb 1999 18:50:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Stromberg <eplmst AT lu DOT erisoft DOT se>,
DJGPP-WORKERS <djgpp-workers AT delorie DOT com>
Subject: Re: _llseeks()'s return value
In-Reply-To: <Pine.SUN.3.91.990203171810.14316C-100000@is>
Message-ID: <Pine.SUN.3.91.990203184129.21364B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

On Wed, 3 Feb 1999, I wrote:

> > Somebody doesn't happen to know some interrupt for seeking that
> > returns valid data on file positions bigger than 2^31?
> 
> I will try to search my references.

I looked, but didn't find anything.

You could work around the problem by going all the way back to the 
beginning of the file from the original position, and then computing the 
final position on your own, though.  The simple-minded way would be to go 
back one byte at a time until you hit the beginning; a much faster way is 
to use whatever is returned by lseek as the step size, until you get past 
the beginning, then compute the size by adding the last (negative) result 
with the positive steps you did before that.

If the above works and isn't too slow, maybe that's the way to go?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019