This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Symlinks under /proc


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]