Re: lseek: Value too large for defined data type
- From: Tim Southerwood <ts@xxxxxxxxxx>
- Date: Fri, 20 Jul 2007 11:42:46 +0100
guru wrote:
Hi All,
I have written 21GB file and updating the file by seeking 1K and
writing 100MB of data consecutively 10240 times. when after writing
2GB(2100 times) of file it was giving
lseek: Value too large for defined data type error.
What is got is the value passed to 'Offset' argument is too large to
handle.
The last return value of seek is '2099270656'
Is there any way to overcome this.
Thanks & Regads
Gururaja
Yes - it is a standard problem, with a standard set of solutions.
off_t is normally defined as a 32 bit signed.
Try man lseek64
In summary from that page, you can either explicitly use lseek64() and
off64_t (not portable where lseek64 is not defined but you don't need >2GB
support)
or leave everything as "off_t" and "lseek()" but do a
#define _FILE_OFFSET_BITS 64
higher up in the source (or via the Makefile or whatever)
and that will cast lseek to lseek64 and off_t to off64_t on systems that
suppport it.
HTH
Tim
.
- Follow-Ups:
- Re: lseek: Value too large for defined data type
- From: phil-news-nospam
- Re: lseek: Value too large for defined data type
- References:
- lseek: Value too large for defined data type
- From: guru
- lseek: Value too large for defined data type
- Prev by Date: lseek: Value too large for defined data type
- Next by Date: Re: PLEASE HELP - Very odd kernel panic problem
- Previous by thread: lseek: Value too large for defined data type
- Next by thread: Re: lseek: Value too large for defined data type
- Index(es):