This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][BZ #14627] Make linux close errno to EINPROGRESS when interrupted in signal.
- From: Christoph Hellwig <hch at lst dot de>
- To: Rich Felker <dalias at aerifal dot cx>
- Cc: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Thu, 5 Dec 2013 20:58:02 +0100
- Subject: Re: [RFC][BZ #14627] Make linux close errno to EINPROGRESS when interrupted in signal.
- Authentication-results: sourceware.org; auth=none
- References: <20131205171054 dot GA14905 at domone dot podge> <52A0B6B5 dot 1010605 at linux dot vnet dot ibm dot com> <20131205175749 dot GL24286 at brightrain dot aerifal dot cx>
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.