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

problems using large file systems

I have a intel box running redhat 8.I am trying to use large file support in ext3 but have hit the following snag.
I have a file that was created using lfs :

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;

fd = open("/home/amitm/storage/cam_n2_q1/atvdatacam_n2_q1.dat",O_RDONLY);
if (fd < 0) {
printf("error opening file errno = %d\n",errno);

   result = lseek64(fd,2147483650,SEEK_SET);
   if (result < 0) {
       printf("error seeking file errno = %d\n",errno);

   return 0;

I build the code like this:

gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -o seektest.o seektest.c
seektest.c: In function `main':
seektest.c:21: warning: decimal constant is so large that it is unsigned
gcc -o seektest seektest.o

Now running seektest I get the following error:

-bash-2.05b$ ./seektest
error seeking file errno = 0

Any ideas what is going on ?

Best Wishes

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