fopen() and max number of open files
Does fopen() have a maximum size limit for a process on Sharc 21369 ? I can't open more than 7 files in my program. Is it configurable?
Thanks very much.
There are no explicit restrictions on the number of files you can open, however they are limited implicitly by available heap space. When using fopen, each opened stream requires 72 bytes of file table and, by default, a 512-byte I/O buffer (that is allocated when the stream is first read or written).
This memory is acquired from the heap, so without a sizeable heap you may find that fopen attempts fail, and I suspect that may be what is happening when you try to fopen your 8th file.
The thread below talks about a similar issue
As we see that the cause of the problem there too was limited size of the heap.
Not sure if this is the same issue or a different one?
Retrieving data ...