Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Dec 2018 02:43:40 +0000
From: Orivej Desh <orivej@....fr>
To: musl@...ts.openwall.com
Subject: Re: sem_wait and EINTR

* Rich Felker <dalias@...c.org> [2018-12-05]
> On Wed, Dec 05, 2018 at 10:27:16PM +0100, Ondřej Jirman wrote:
> > On Wed, Dec 05, 2018 at 08:47:59PM +0100, Markus Wichmann wrote:  
> > 
> > It's specified by POSIX:
> > 
> > https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html
> > 
> > Sates: "The sem_wait() function is interruptible by the delivery of a signal."  
> 
> This seems contradictory with EINTR being a "may fail" error, and, if
> interpreted the way you want to interpret it, seems to be
> contradictory with SA_RESTART semantics, since it doesn't say anything
> about whether that signal is an interrupting one. I think we should
> attempt to obtain a clarification on what the intent is here. Does "is
> interruptible" mean that it needs to fail on signals (only without
> SA_RESTART?) or simply that signal handlers must be permitted to run
> (i.e. the wait can't happen with signals blocked)?

There is a definition of interruptible functions on the sigaction page:

    SA_RESTART

    This flag affects the behavior of interruptible functions; that is, those
    specified to fail with errno set to [EINTR].

    If set, and a function specified as interruptible is interrupted by this
    signal, the function shall restart and shall not fail with [EINTR] unless
    otherwise specified.

    If the flag is not set, interruptible functions interrupted by this signal
    shall fail with errno set to [EINTR].

https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.