This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: Symlinks under /proc
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 1 Feb 2005 10:12:40 +0100
- Subject: Re: Symlinks under /proc
- References: <20050129115137.GA3435@cygbert.vinschen.de> <048801c5062d$176ab010$0207a8c0@avocado> <20050131103635.GB19009@cygbert.vinschen.de> <Pine.GSO.4.61.0501311218420.28344@slinky.cs.nyu.edu> <20050131173157.GH31117@cygbert.vinschen.de> <Pine.GSO.4.61.0501311240520.28344@slinky.cs.nyu.edu> <20050131210310.GA24285@cygbert.vinschen.de> <Pine.GSO.4.61.0501311844460.1517@slinky.cs.nyu.edu>
- Reply-to: cygwin-developers at cygwin dot com
On Jan 31 19:02, Igor Pechtchanski wrote:
> On Mon, 31 Jan 2005, Corinna Vinschen wrote:
> > Talking about experiments, did you also try it on Cygwin if it works or
> > did you just look on Linux how it's implemented there?
>
> I tried it on the CVS HEAD. Making /dev/stdin a symlink works wherever
> /proc/self/fd/0 works (as expected).
> Both work perfectly for programs invoked directly from the bash command
> line. Pipes are another story. The following fails for me:
>
> $ echo "blaaah" | perl -pe 's/aaa/bbb/g' /proc/self/fd/0
> Can't open /proc/self/fd/0: No such file or directory.
>
> This shows some more detail:
>
> $ echo "blaaah" | perl -e 'print `ls -l /proc/self/fd/0 2>&1`,`ls -lL /proc/self/fd/0 2>&1`'
> lrwxrwxrwx 1 igor root 0 Jan 31 18:54 /proc/self/fd/0 -> pipe:[1700]
> ls: /proc/self/fd/0: No such file or directory
>
> Could it be that the pipe is closed before the child process completes?
> But no, making the first process in the pipe longer-running doesn't help:
>
> $ (echo "blaaah";sleep 10;echo "blaaarg") | perl -e 'print `ls -lL /proc/self/fd/0`'
> $ (echo "blaaah";sleep 10;echo "blaaarg") | perl -e 'print `ls -l /proc/self/fd/0 2>&1`,`ls -lL /proc/self/fd/0 2>&1`'
> lrwxrwxrwx 1 igor root 0 Jan 31 18:54 /proc/self/fd/0 -> pipe:[1700]
> ls: /proc/self/fd/0: No such file or directory
>
> Doesn't look like the symlink target is valid.
Correct. The name for pipes and, FWIW, AF_INET sockets, is generated
following the Linux naming rules, but it's not possible to resolve it.
I'm not sure how to implement that right now.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:cygwin@cygwin.com
Red Hat, Inc.