This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]