|
| From: | Chet Ramey |
| Subject: | Re: [PATCH] Fix blocking read timeouts at a small probability |
| Date: | Wed, 10 Feb 2021 18:02:34 -0500 |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/10/21 11:59 AM, Koichi Murase wrote:
I'd also like to know how this is going to work with read -e and readline, since those don't seem to know anything about the timer.OK, that is a good point. I completely forgot about `read -e'. I took a look at `rl_getc (stream)' (lib/readline/input.c). If one wants to switch to this approach, the timeout needs to be specified for the pselect(2) calls in `rl_getc ()'. In that case, I think readline could provide a proper public interface to accept the setting of the timeout. Because readline might be linked with different versions of Bash, the handling of SIGALRM in readline can be left as is, but the new interface for the timeout can be just added?
You'll have to hook the timeout code into the pselect/select calls, as you
suspect. Take a shot and it and send me what you come up with.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
| [Prev in Thread] | Current Thread | [Next in Thread] |