fwrite() in Linux
From: LaBird (wlcheung1975_at_hkucs2004.org)
Date: Tue, 22 Jun 2004 13:48:56 +0800
I have written a program which makes use of a lot of file I/O
with fopen(), fread(), fwrite() and fclose(). But somewhere
in the program execution, the program abnormally exits without
telling what the error is. I have checked that it is the fwrite()
causing the problem (seems it is the 10000th or later fwrite() in
my loop that causes the problem). However, since it exits right
away, I cannot make use of the return value or errno (if any,
since the man page of fwrite does not specify whether
errno is set when fwrite gets a problem) at all.
Judging from this symptom, is it possible to tell what is the
error causing such abnormal exit without printing the problem?
It does not seem like segmentation fault (since if it is, such line
should have printed out). What about other possibilities, such
as (1) disk space used up, (2) memory used up, (3) too many
files inside a directory, or others?
Thank you very much in advance.
Email: remove all numerals to get the correct email address.