linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rich Felker <dalias-8zAoT0mYgF4@public.gmane.org>
To: Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Erroneous text about EINTR in futex man page
Date: Thu, 4 Dec 2014 14:08:46 -0500	[thread overview]
Message-ID: <20141204190846.GA25606@brightrain.aerifal.cx> (raw)

The following text in the futex(2) man page seems incorrect:

       EINTR  A FUTEX_WAIT operation was interrupted by a signal (see
              signal(7)) or a spurious wakeup.

I see no code in the kernel whereby a "spurious wakeup", or anything
other than interruption by a signal handler that's not SA_RESTART, can
cause futex to fail with EINTR. In general, overloading of EINTR
and/or spurious EINTRs from a syscall make it impossible to use that
syscall for implementing any function where EINTR is a mandatory
failure on interruption-by-signal, since there is no way for userspace
to distinguish whether the EINTR occurred as a result of an
interrupting signal or some other reason. The kernel folks have gone
to great lengths to fix spurious EINTRs (see signal(7) for history),
especially by non-interrupting signal handlers, including in futex,
and allowing EINTR here would be contrary to that goal.

It's my belief that the "or a spurious wakeup" text should simply be
removed.

The reason I'm raising this topic is its relevance to a thread on
libc-alpha:
[RFC] mutex destruction (#13690): problem description and workarounds

Rich
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-12-04 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 19:08 Rich Felker [this message]
     [not found] ` <20141204190846.GA25606-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2015-01-15  9:00   ` Erroneous text about EINTR in futex man page Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141204190846.GA25606@brightrain.aerifal.cx \
    --to=dalias-8zaot0mygf4@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).