[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: problems using large file systems



Hi Stephen,
I found the bug in the code yesterday and made it into a 64bit type. The program works fine with the change.
Thanks for your input.
Best Wishes
Amit



Stephen C. Tweedie wrote:


Hi,

On Fri, 2003-11-14 at 00:29, amitm atvideo com wrote:



rw-r--r-- 1 amitm amitm 2147491330 Nov 13 10:16 /home/amitm/storage/cam_n2_q1/atvdatacam_n2_q1.dat

I write a simple program to do the basic file I/O but I hit a snag doing the seek.

int main(void)
{
int fd;
int result;


...


result = lseek64(fd,2147483650,SEEK_SET);



Umm, lseek64 returns a 64-bit result. "result" is a 32-bit variable.


This is *precisely* the sort of programming error which resulted in the
LFS spec disabling the opening of >2GB files in the first place.  Any
applications assuming that an off_t fits in an int will break if off_t
for the file is larger than 2GB.

Try off_t or loff_t as the type for "result" and see if that works any
better!

--Stephen

.









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]