delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/02/16/04:53:09

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 16 Feb 2008 10:52:12 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: AW: 1.5.25-7 piping directed output to /dev/stdout will not work
Message-ID: <20080216095212.GA9304@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4971562D0CDBAE4A86212E08861E9C4F038D779E AT si-mail46 DOT de DOT bosch DOT com> <47B59B10 DOT 5090105 AT byu DOT net> <4971562D0CDBAE4A86212E08861E9C4F038D77A3 AT si-mail46 DOT de DOT bosch DOT com> <47B66A3F DOT 4030804 AT byu DOT net>
MIME-Version: 1.0
In-Reply-To: <47B66A3F.4030804@byu.net>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Feb 15 21:44, Eric Blake wrote:
> Earlier versions of bash did not install a /dev/stdout symlink, but
> special cased it directly in bash.  It may be that this has always been
> broken on cygwin, but because bash was special-casing things instead of
> relying on a symlink, no one noticed.  But now that bash installs a
> /dev/stdout symlink, it would be nice if cygwin could be patched to match
> Linux behavior on reopening /dev/stdout.

/dev/stdout is nothing special for Cygwin.  /dev/stdout is just a
symlink pointing to /proc/self/fd/1.  /proc/self is just a symlink to
/proc/<pid>.  /proc/<pid>/fd/1 is just a symlink to the file opened
in this process using fd 1.  After the symlink expansion has taken
place, there's nothing left of /dev/stdout in the path handling.
It's not even clear anymore, that this file is an open file in *this*
very process.

How is Cygwin supposed to know that it is a symlink with a special
meaning?  Do you think that Cygwin should test every file on every open
to be "/dev/stdout"?

OTOH, if you can come up with a nice solution, PTC.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019