bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a patch to fix sh_stat on SunOS


From: Chet Ramey
Subject: Re: a patch to fix sh_stat on SunOS
Date: Wed, 10 Aug 2016 09:56:02 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 8/9/16 9:12 PM, Dmitry Goncharov wrote:
> Good morning,
> 
> The following piece of shell code does not work on sunos.
> mkfifo /tmp/pipe
> cat < /tmp/pipe &
> exec 6>/tmp/pipe
> test -p /dev/fd/6 && echo pipe
> 
> The reason is on sunos /dev/fd/6 is a special character file, not a pipe
> (unlike bsd), not a symlink (unlike linux, cygwin).
> sh_stat ends up calling stat("/dev/fd/6", finfo) and obtains stat of /dev/fd/6
> file rather than stat of the file pointed to by fd 6.

So what you're saying is that you don't like how SunOS implements /dev/fd
and you'd like bash to override the native implementation semantics.  Bash
is going to preserve the OS behavior of /dev/fd wherever possible, so I'm
not going to apply this patch without a much more compelling reason.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]