Subject: Re: bug#30368: ‘select’ returns non-empty sets upon EINTR or EAGAIN

From: [email-masked] (Ludovic Courtès)
Date: Wed, 07 Feb 2018 14:33:58 +0100

[email-masked] (Ludovic Courtès) skribis:

> On 2.2.3, it prints:
>
> $ guile select.scm
>
>
> ;;; (signal! (2))
> ;;; (reading-from #<input: file /dev/pts/9>)
>
>>>From there on it’s stuck in a read(0, …) call.
>
> The attached patch fixes it by clearing the returned FD sets on
> EINTR/EAGAIN.

There’s a case where we can get a “fake” EINTR that doesn’t come from
the underlying select(2) call: when the ‘scm_i_prepare_to_wait_on_fd’
call in ‘scm_std_select’ returns 1, which happens when new asyncs have
been queued.

Ludo’.