Re: File Size Limit Exceeded - How to handle work around this?




Michael wrote:
I wrote a simple program to continue to create a very large file (on
purpose), and even though there is plenty of disk space on that device
the program aborted with the error message "File Size Limit Exceeded".
The file size was 2147483647. I checked ulimit -a and its set to
unlimited.

Is this a compiler issue? I would like to see a C code example of how
to increase the limit or make it unlimited (if that is a wise thing to
do).

It's been a long time, though, so this advice may be dated.

A long time ago, when the Linux 2.4 kernel was new (i.e., when 64-bit
file sizes were just starting to catch on), we used to have this same
problem. Back then, you had to compile with some special symbol
defined, LARGE_FILES or something like that. That caused the typical
file size types (offset_t and the like) to be 64 bit. You might find
something like that in the compiler documentation.

Of course, to narrow it to OS or C, you could have your program write
to stdout and redirect to a file. If it still doesn't work, you have
an OS problem. And if it isn't C, it could be your OS kernel, or your
shell, or your filesystem (e.g., NFS) that has some kind of limit in
it.

Michael

Thanks for the suggestion. I made another version of this C program,
where it writes to standard output and piped the output to a file. It
had no problem creating a file size over 3GB, exceeding the 2GB limit I
encountered.
This system is using gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) which
is what came with the latest version of CentOS. The kernel is:
[root@localhost proc]# cat /proc/version
Linux version 2.6.9-42.0.3.EL (buildsvn@build-i386) (gcc version 3.4.6
20060404

.



Relevant Pages

  • amd64 bitops fix for -Os
    ... filesystem, the kernel mostly hangs. ... When optimizing for speed, the generated code is such that the flags ... Obviously the asm statement must not rely on the compiler setting up ... -inline long find_first_zero_bit(const unsigned long * addr, ...
    (Linux-Kernel)
  • Re: amd64 bitops fix for -Os
    ... > kernel build. ... because its inline asm assumes at least one iteration ... the generated code is such that the flags ... although in a perfect world the compiler would be ...
    (Linux-Kernel)
  • Re: Problem setting up lm-sensors
    ... >> they built the kernel. ... >> Why does the Makefile not use .config? ... >> I assume no one wants to see that 727 line Makefile. ... >> question as to what compiler I should use. ...
    (comp.os.linux.misc)
  • Re: Micro$haft desperate! Buy Windoze 7, get (virtual) XP free!
    ... it's not even Windows, it's what MS's C++ compiler does. ... Because device drivers in operating systems with monolithic kernels, and in many operating systems with hybrid kernels, execute within the operating system kernel, it is possible to run the kernel as a 32-bit process while still supporting 64-bit user processes. ... Leopard with no trouble. ... rather not having 64-bit Carbon when the apps that want all that memory use Carbon. ...
    (comp.sys.mac.advocacy)
  • Newbie Q: spca5xx webcam driver installation problem
    ... with the included default makefile. ... Building SPCA5XX driver for 2.5/2.6 kernel. ... # Setup the tools ... # Setup compiler warnings ...
    (comp.os.linux.setup)