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

Re: problems using large file systems



I do a :
fd = open("/home/amitm/storage/cam_n2_q1/atvdatacam_n2_q1.dat",O_LARGEFILE | O_RDONLY);

I still get the same error.

The documentation ( http://www.suse.de/~aj/linux_lfs.html) says:

For using LFS in user programs, the programs have to use the LFS API. This involves recompilation and changes of programs. The API is documented in the glibc manual (the libc info pages) which can be read with e.g. "info libc".

In a nutshell for using LFS you can choose either of the following:

   * Compile your programs with "gcc -D_FILE_OFFSET_BITS=64
     -D_LARGEFILE_SOURCE". This forces all file access calls to use the
     64 bit variants. Several types change also, e.g. off_t becomes
     off64_t. It's therefore important to always use the correct types
     and to not use e.g. int instead of off_t.
   * Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE. With these
     defines you can use the LFS functions like open64 directly.
   * Use the O_LARGEFILE flag with open to operate on large files.

Defining -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE should do the trick provided the kernel support and the right glibc is present.


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