This is the mail archive of the 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.

From: Rich Felker <>
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().

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