Re: lseek: Value too large for defined data type




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.


As others have said, add -D_FILE_OFFSET_BITS=64 to the compiler command line

I have found that it is a good idea to also add -D_LARGEFILE64_SOURCE to the
command line as well.

--
Bill C.


.



Relevant Pages