Re: What's the practical use of the error close() returns?

2012-07-28 Thread Shachar Shemesh
On 07/27/2012 02:52 PM, Elazar Leibovich wrote: (as mentioned earlier, the no space left could just as well happen after the file was closed, so I don't mind that much it's not reported on a close()) Ehm, no. First of all, please note a subtle but important difference between your question

Re: What's the practical use of the error close() returns?

2012-07-28 Thread Amos Shapira
BTW - everyone here keeps assuming that close(2) is called on disk files, what about other types of file descriptors (sockets, pipes, character and block devices, virtual filesystem files)? How would you adjust your answers for that case? On 28 July 2012 16:56, Shachar Shemesh shac...@shemesh.biz

Re: What's the practical use of the error close() returns?

2012-07-28 Thread Daniel Shahaf
Shachar Shemesh wrote on Sat, Jul 28, 2012 at 09:56:40 +0300: On 07/27/2012 02:52 PM, Elazar Leibovich wrote: (as mentioned earlier, the no space left could just as well happen after the file was closed, so I don't mind that much it's not reported on a close()) Ehm, no. First of

Re: What's the practical use of the error close() returns?

2012-07-28 Thread Shachar Shemesh
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). Shachar --