I've created a simple application that is supposed to fill up a file with messages up
to the size I pass as parameter.
The problem is that once the file reaches the 2GB size, it stops growing.
The flow of the application, for what is worth, is as follows:
while ( bytes written < bytes wanted )
create message;
fwrite message;
free message;
At first I thought it was something related to some default limit of the file system (perhaps some obscure ubuntu configuration), so I tried with dd but I managed to create a 7GB file.
I then realized that I was passing the size as a parameter in bytes `expr 1024 * 1024 * 1024 * 4` which was converted with atoi and assigned to an int variable, so I thought that was problem. I decided to manually set the size internally using an unit64_t variable set to 4GB, but the result is the same.
I also tried to attach to the process with gdb once the size of 2147483647 bytes was reached but the flow was just normal (althought I don't check the return value of fwrite).
My problem here is not only to be able to write with my application to a file until it reaches a certain size, but also to understand why it does not work as it is coded right now.
Yeah! That worked. Thank you very much.
Now I want to understand what the problem was.
Unfortunately info libc says "No menu item `libc' in node `(dir)Top'".
and I don't know how to get it in Ubuntu.
Care to explain with few words or point me somewhere else beside info?
Otherwise I'll just google!