On 2/8/21 9:37 AM, Koichi Murase wrote:
Instead, I believe, it is more natural to use `select(2)', which is
already used to implement `read -t 0'. In the attached patch
`0001-Use-select-2-for-the-read-timeout.patch', I used `select(2)'
to implement the timeout of `read(2)'. When `select(2)' is
unavailable (i.e., `HAVE_SELECT' is defined in `config.h'), it still
falls back to the old strategy with `SIGALRM', but I believe most of
modern systems support `select(2)'. I tested the behavior with the
above test case, and also tested the behavior by hand. Could you
take a look at the patch?
Thanks for the analysis and patch. I'll take a look. At first glance, I
would like to find a simpler way to do it.