G
Guest
I'm running an application on an embedded device running Linux (2.6.21
kernel) . I've found that when the CPU load gets really high on the
device, output to a file stream sometimes fails.
When I turn on exceptions, the what() method from the exception that
gets thrown just tells me that there's a basic_ios::clear error, and
I've verified that errno is 0.
Does anyone have any suggestions about what I can do?
I thought about retrying, since subsequent writes to that stream
apparently work. However, my concern is that I don't know the nature
of the failure. Say I attempted to do a write of 10 bytes from a
character buffer. Is there any way to tell if it failed and none of
the bytes got written out, 2 of the bytes, or 9?
The file system that my ofstream is writing out to is actually a
ramdisk partition (tmpfs file system).
I don't mind retrying, if necessary, but I need the output of the
stream to be correct, which means I need to know from where I should
be retrying.
Any ideas?
kernel) . I've found that when the CPU load gets really high on the
device, output to a file stream sometimes fails.
When I turn on exceptions, the what() method from the exception that
gets thrown just tells me that there's a basic_ios::clear error, and
I've verified that errno is 0.
Does anyone have any suggestions about what I can do?
I thought about retrying, since subsequent writes to that stream
apparently work. However, my concern is that I don't know the nature
of the failure. Say I attempted to do a write of 10 bytes from a
character buffer. Is there any way to tell if it failed and none of
the bytes got written out, 2 of the bytes, or 9?
The file system that my ofstream is writing out to is actually a
ramdisk partition (tmpfs file system).
I don't mind retrying, if necessary, but I need the output of the
stream to be correct, which means I need to know from where I should
be retrying.
Any ideas?