[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: poor <&- behavior under ulimit -n
From: |
Chet Ramey |
Subject: |
Re: poor <&- behavior under ulimit -n |
Date: |
Fri, 05 Nov 2010 23:16:59 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 |
On 10/27/10 6:25 PM, Eric Blake wrote:
> Description:
> Bash does not behave well when under artificial fd pressure due to
> ulimit -n. It issues a spurious warning to stderr because it tries
> to save necessary fds starting at 10. Compare this with ksh93, which
> saves fds starting at 3.
>
> Many other shells (for example, dash or BSD /bin/sh) exit with
> non-zero status if they can't use fd 10, rather than proceeding onwards.
> At any rate, bash MUST exit with failure if it cannot save an fd, even
> if you decide that it is unsafe to copy ksh93's action of saving at fd
> 3 rather than 10.
That's not actually true. What bash must do is to throw a redirection
error, which has specific Posix-defined consequences in a non-interactive
shell, which differ between special builtins and other utilities.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: poor <&- behavior under ulimit -n,
Chet Ramey <=