Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 08 Dec 2014 15:29:53 +0100
From: Laurent Bercot <ska-dietlibc@...rnet.org>
To: musl@...ts.openwall.com
Subject: Re: [RFC] EINTR and PC loser-ing library design

On 08/12/2014 15:10, Rich Felker wrote:

> I don't see what problem you're trying to solve. EINTR does not happen
> unless you intentionally request it by setting up an interrupting
> signal handler, using sigaction() with the SA_RESTART flag clear.

  What about SIGSTOP, and its cousins SIGTSTP, SIGTTIN and SIGTTOU ?
  Even when you don't request anything, you can receive them. They
stop the process, they don't kill it. What happens when the process
resumes, if it was interrupted in the middle of an interruptible
system call ?


> Retry-on-EINTR loops are generally misguided unless they're in code
> that's intended to be using in programs which use interrupting signal
> handlers, but which need to reliably complete an operation even if
> interrupted.

  And that happens all the time in asynchronous event loops where you
handle signals with a self-pipe. ;)

-- 
  Laurent

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.