mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [RFC] EINTR and PC loser-ing library design
Date: Mon, 8 Dec 2014 11:00:10 -0500	[thread overview]
Message-ID: <20141208160010.GH4574@brightrain.aerifal.cx> (raw)
In-Reply-To: <5485C86C.4090407@skarnet.org>

On Mon, Dec 08, 2014 at 04:49:00PM +0100, Laurent Bercot wrote:
> On 08/12/2014 16:28, Rich Felker wrote:
> >The only such exception I'm aware of is that POSIX allows, but does
> >not require, select to fail with EINTR even when SA_RESTART is used.
> 
>  What do you say of poll ?
> 	The poll() function shall fail if:
> 	[EINTR]
> 	     A signal was caught during poll().
> 
>  Note that it is "shall", not "may".
> 
>  One may argue that the SA_RESTART behaviour has priority over "poll() shall
> fail with EINTR if a signal is caught", as with other functions such as
> read(), but one may also argue that, just as with select(), it makes perfect
> sense to *not* restart poll() when a signal is caught, since time has elapsed
> since the original call and the application may want to update the timeout
> values, so the exception that applies to select should also apply to poll.

Since poll does not have explicit text overriding the text on
SA_RESTART, my understanding is that it's required to obey SA_RESTART.
However it's unclear because most functions which have EINTR as a
specified error use the phrase "the function was interrupted
[before]..." (in particular, the word "interrupted" appears) whereas
the text for poll merely says "a signal was caught". This should
probably be clarified. Note that the Linux behavior is that poll
restarts automatically. I'm not sure about select.

Rich


      reply	other threads:[~2014-12-08 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <esmoarexomn.wl-danny.milo+a@gmail.com>
2014-12-08 14:04 ` dannym
2014-12-08 14:10   ` Rich Felker
2014-12-08 14:29     ` Laurent Bercot
2014-12-08 14:32       ` Rich Felker
2014-12-08 14:45         ` Laurent Bercot
2014-12-08 15:00           ` Rich Felker
2014-12-08 15:09             ` Rich Felker
2014-12-08 15:18           ` dannym
2014-12-08 15:28             ` Rich Felker
2014-12-08 15:49               ` Laurent Bercot
2014-12-08 16:00                 ` Rich Felker [this message]

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=20141208160010.GH4574@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).