[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: write() not retried after EINTR in printf and echo
From: |
Chet Ramey |
Subject: |
Re: write() not retried after EINTR in printf and echo |
Date: |
Fri, 12 Jan 2018 12:55:30 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 1/12/18 12:05 PM, Serge van den Boom wrote:
> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
>
> Description:
> If during an 'echo' or 'printf', the write() system call returns an
> EINTR error, the write() call is not retried.
> This can can happen when a system call is interrupted when a
> signal is received, which can happen when the user resized the
> terminal while the write() call is blocked.
There are a couple of signals for which this is the appropriate behavior.
The right fix is to install handlers with the SA_RESTART flag set. The
next version of bash will install its SIGWINCH handler with SA_RESTART.
--
``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/