Maximum File Size

Hi,

When i checked for the maximum file size on solaris 5.9
the max file size obtained was only 2147483647

and all the further writes to the file which had reached that max size is not added to that file.

even i had registered the signal SIGXFSZ, but the signal was not delivered to the program upon reaching the size

and to my astonishment,
once the file had reached the size 2147483647,
i tried with this simple redirection command
echo "abc" >> filename_max (it worked)
then found that file size was increased to 2147483651

then made a try to close the file pointer and reopen it if reached the maximum size, but ended in vain.

After reaching the maximum file size how is it able to further add contents to the file through the redirection operator and not through direct fprintf operation as such ?

could somebody please throw light upon this?
I really could not proceed.

Thanks,
Mad.

Are there large file non-standard C functions on your box - like fopen64?
I would expect that to be true, and you need to use them to be able to write to large files, ie 64 bit file pointers required.

All of the system level calls obviously support this or you could not get a positive file size larger then what the 32 bit ssize_t datatype supports.

that was a thunder Jim. :wink: :wink: :wink:

Is that the case that I had mentioned generating file of more than 2GB... legal to generate a SIGXFSZ signal to be delivered to the program.

I cannot pinpoint at the handlers that they werent correct. I have the other essential program guard signals working perfectly.

I doubt whether SIGXFSZ signal is generated from the above scenario :confused:

Because the system supports large files you get no signal.

i find it difficult to understand...

say for a system where the file size is unlimited
is the meaning of the signal SIGXFSZ is null?

if so,
then what is the meaning in having those signals under VALID signals that can be delievered to the program by the kernel !!! :slight_smile:

I'm not communicating.

Example:
If you have called setrlimit and set the max file size down to a number, say 100000, then the kernel will send SIGXFSZ to your process. When your file size hits the limit. You then call setrlimit and bump up the value.

If you do not call setrlimit, then the kernel will send SIGXFSZ when your process hits the system-wide value (or the per-process-defined value) for max file size.

The fact that your system seems to support 64-bit file size means:
Your default system max file size is probably more than 2147483647.
It is not clear to me how you arrived at 2147483647.
Did you set that value with setrlimit?
If file size shows "unlimited" it means that it uses the system-wide setting.
"unlimited" does not mean unlimited or infinite. It just means that the process limit is the same as the system.

Try playing with setrlimit on very small files and see what happens. Then you can create a model that will work on really big files.