[Toybox] Ok, I've given myself a headache trying to understand this one.

Chet Ramey chet.ramey at case.edu
Fri May 29 11:59:50 PDT 2020


On 5/29/20 11:22 AM, Rob Landley wrote:
> Running a mkroot build, it went:
> 
> Compile toybox....scripts/make.sh: line 34: echo: write error: Resource
> temporarily unavailable
> ...scripts/make.sh: line 34: echo: write error: Resource temporarily unavailable
> ............scripts/make.sh: line 34: echo: write error: Resource temporarily
> unavailable

OK. Bash will do that if the write fails. It looks like fflush() fails and
errno gets set to EAGAIN, which is only supposed to happen if the stdout fd
is set to non-blocking. Bash doesn't set it that way, but the write returns
-1/EAGAIN for some reason.


> I have no idea why the pipe or terminal it's outputting to is congested. There's
> nothing in dmesg about it. But that's not the problem: I _assume_ bash's echo
> won't output a message for that, and my echo should not output a message for
> this either. (temporarily means it should retry? My echo hasn't set any signal
> handlers and the default behavior is SA_RESTART?)

Bash doesn't mess with the signal behavior in that sense -- the only
signals it sets SA_RESTART on are SIGCHLD, SIGWINCH, and, in previous
versions, SIGTERM. None of that should be happening in a non-interactive
shell.

But I don't assume that -1/EAGAIN is the result of a signal. It could
potentially be SIGCHLD, but bash sets that to SA_RESTART when it installs
its handler.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/



More information about the Toybox mailing list