This is the mail archive of the
mailing list for the glibc project.
Re: [RFC] EINTR and PC loser-ing library design
- From: Rich Felker <dalias at libc dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 8 Dec 2014 10:41:25 -0500
- Subject: Re: [RFC] EINTR and PC loser-ing library design
- Authentication-results: sourceware.org; auth=none
- References: <esmoarexomn dot wl-danny dot milo+a at gmail dot com> <5485A774 dot 6020608 at redhat dot com>
On Mon, Dec 08, 2014 at 02:28:20PM +0100, Florian Weimer wrote:
> On 12/08/2014 02:22 PM, email@example.com wrote:
> >- add an intr_handler callback (pointer) to glibc, setable by the user, defaulting to one just returning (-1).
> Using a callback is very dubious because it is difficult to specify
> its semantics, and it will negatively interfere with current and
> future compiler optimizations.
> Maybe a thread-local flag which controls retry-on-EINTR behavior
> might make sense, but it's reasonable to check what other systems do
> first (and perhaps bring this up in the Austin working group for
> POSIX standardization).
This was cross-posted to the musl list, and my response there was that
I don't see any problem it's solving. As long as you install signal
handlers with SA_RESTART (or not at all), you don't ever get EINTR. If
you're using interrupting signal handlers intentionally, then
presumably you want the interrupting behavior, so any global override
of the interrupting behavior with auto-restart would be wrong. Such
override would need to be local only in the places where you don't
want the interrupting behavior.