[RFC][BZ #14627] Make linux close errno to EINPROGRESS when interrupted in signal.

Christoph Hellwig hch@lst.de
Thu Dec 5 20:01:00 GMT 2013


On Thu, Dec 05, 2013 at 12:57:49PM -0500, Rich Felker wrote:
> Note that, for the most part, close on Linux does not return EINTR.
> The only way it can happen is with certain devices (for testing this
> issue, I had someone helping me test it write a kernel module for a
> fake device that always blocks in close and returns EINTR when
> interrupted) and perhaps custom filesystems. So a change here will not
> impact most applications.

Returning EINTR in Linux is incredibly hard.  While the normal ->release
method that is called on drop of the final reference to a file does return
an error, it is explicitly ignored.

A filesystem or character device driver would have to implement the
special ->flush method that is called on every close method to be able
to return an error, and returning EINTR from that is discouraged.  I
wouldn't mind adding a check to enforce that either.



More information about the Libc-alpha mailing list