This is the mail archive of the
mailing list for the glibc project.
Re: [RFC][BZ #14627] Make linux close errno to EINPROGRESS when interrupted in signal.
- From: David Miller <davem at davemloft dot net>
- To: dalias at aerifal dot cx
- Cc: eagle at eyrie dot org, libc-alpha at sourceware dot org
- Date: Thu, 05 Dec 2013 19:37:39 -0500 (EST)
- Subject: Re: [RFC][BZ #14627] Make linux close errno to EINPROGRESS when interrupted in signal.
- Authentication-results: sourceware.org; auth=none
- References: <20131205 dot 155009 dot 707968344039994800 dot davem at davemloft dot net> <87ob4vggn3 dot fsf at windlord dot stanford dot edu> <20131205223223 dot GQ24286 at brightrain dot aerifal dot cx>
From: Rich Felker <email@example.com>
Date: Thu, 5 Dec 2013 17:32:23 -0500
> The new requirement is that EINTR means the fd is still open and
> EINPROGRESS means the operation was interrupted by a signal but the fd
> is no longer valid.
A behavior specified by POSIX is quite pointless considering decades
of precedence, which to me is more important than any standards
close() cannot error if it is given a valid file descriptor, it would
break decades worth of existing code. And practically speaking,
returning errors on close() was tried for NFS in the Linux kernel
about 12 or 13 years ago, things broke and we had to revert that
change immediately. You simply cannot do it.
Leaving a file descriptor open after a close() is also asking for very
serious security problems. Just unpack an arbitary source tree and
grep for close() calls, how many are checking for errors at all?
Of the few that do, how do they handle it? Most just do something on
the order of abort().