What's the practical use of the error close() returns?
Daniel Shahaf
d.s at daniel.shahaf.name
Sun Jul 29 15:37:26 IDT 2012
Shachar Shemesh wrote on Sun, Jul 29, 2012 at 06:35:18 +0300:
> On 07/29/2012 02:12 AM, Daniel Shahaf wrote:
> > So if the disk hardware fails after close() returns but before the OS
> > caches are flushed...
>
> It is not part of close(2)'s job description to protect against this
> scenario. If you want to protect against this scenario, use sync(2).
No argument here. Just wanted to explicitly point out that, when you
wrote "cannot fail due to X", it still could fail due to Y.
Cheers,
Daniel
More information about the Linux-il
mailing list