delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/16/22:41:27

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:content-type:date:from:to:subject
:in-reply-to:references:message-id; q=dns; s=default; b=dSyS/vqG
wPBeSvAg0kcDUv2NtvfnP4T3lLtycizaTF1Jt0akkQaT1h73dVifjxqO3eZKftcc
UXOdiMNPrdaJlxJ56hejlQOd2WPFXl7wQWXuKRaRGpbBLCtdZl7NvSklKG+9Ju8a
sEE48/e//qVyrjijmQUDhvahcSz+T4Pmg8E=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:content-type:date:from:to:subject
:in-reply-to:references:message-id; s=default; bh=tzHi3g9yrO9H3n
OHCCubbVXZWYQ=; b=QPV0TBeOZZma7aTEUP5BKKTAuhOlyHKgrPTADZ89SDOMue
CyRqRzTe40nRrxkABthK2OJWOFMcF3jMKipcjZE36x7omrCiTE2aOcd4ff91Kovg
vmabu4nlnu7EpUMGTUJ/VDwkSTdXBrDlL1+t2PKYfhDh/NzVF9jMp5eys5afU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*nl, Hx-spam-relays-external:sk:webmail, H*RU:sk:webmail, H*r:sk:webmail
X-HELO: lb2-smtp-cloud8.xs4all.net
MIME-Version: 1.0
Date: Mon, 17 Dec 2018 04:41:07 +0100
From: Houder <houder AT xs4all DOT nl>
To: cygwin AT cygwin DOT com
Subject: Re: /dev/fd/N not synonymous with file descriptor N; it is on Linux
In-Reply-To: <20181216202847.GK28727@calimero.vinschen.de>
References: <0f030e809f063f5a5e64ff7a7a0c3227 AT xs4all DOT nl> <20181216202847 DOT GK28727 AT calimero DOT vinschen DOT de>
Message-ID: <65de2a8fbe9871597460a4fc762f59bc@xs4all.nl>
X-Sender: houder AT xs4all DOT nl
User-Agent: XS4ALL Webmail
X-IsSubscribed: yes

--=_2e34055594bb021ed7baf8a5a30c16cb
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII;
 format=flowed

On 2018-12-16 21:28, Corinna Vinschen wrote:
> On Dec 16 17:31, Houder wrote:
>> L.S.,
>> 
>> /dev/fd/N not synonymous with file descriptor N; it is on Linux
> 
> Yes, it is.  Most of the time.  Try this:
> 
> $ echo foo | cat /dev/fd/0
> 
> The problem is that some of the concepts don't work as desired:
> 
>> 64-@@ cat /dev/fd/0 <<\EOF
> 
> If you observe what happens in tcsh in this situation you see that it
> doesn't even execute cat as long as you didn't type EOF.  What you type
> is written to a tmpfile:
> 
> $ ls -l /proc/5980/fd
> total 0
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 0 -> /tmp/sh.lVQq04
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 15 -> /dev/pty0
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 16 -> /dev/pty0
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 17 -> /dev/pty0
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 18 -> /dev/pty0
> lrwxrwxrwx 1 corinna vinschen 0 Dec 16 21:15 19 -> /dev/pty0
> 
> However, this tmpfile has been unlinked already, so it has been moved 
> to the
> recycle bin:
> 
> $ ls -l /tmp/sh.lVQq04
> ls: /tmp/sh.lVQq04: No such file or directory
> 
> So the path in the fd subdir doesn't reflect the actual file path.
> 
> But after starting cat, cat tries to open /proc/self/fd/0 which
> is in fact the non-existing path /tmp/sh.lVQq04.  Bad luck.

Yes Corinna, I am aware of the above. I described it here:

     https://cygwin.com/ml/cygwin/2018-12/msg00040.html
     ( Re: Bash heredoc on FD 3 )

Sorry for NOT expressing myself more clearly.

The STC is, as I wrote, based on what I observed on Linux.

See attachment.

Regards,
Henri
--=_2e34055594bb021ed7baf8a5a30c16cb
Content-Transfer-Encoding: base64
Content-Type: text/plain;
 name=disassembly.txt
Content-Disposition: attachment;
 filename=disassembly.txt;
 size=3201

Li4uCgogLSByZWN1cnJpbmcgcGF0dGVybjogdGhlIGZpbGUgZGVzY3JpcHRv
ciB0byB0aGUgdG1wZmlsZSBpcyBkdXAnZWQgdG8gZmQgTiwgd2hlcmUgTiBp
cyBlcXVhbAogICB0byB0aGUgb25lIGluIC9kZXYvZmQvTiwgdGhlIGRldmlj
ZSBmaWxlIHNwZWNpZmllZCB0byBiZSBvcGVuZWQgYnkgdGhlIGNoaWxkLgoK
QEAgc3RyYWNlIC1mZiAtZSBvcGVuLGNsb3NlLHVubGluayxyZWFkLHdyaXRl
LGV4ZWN2ZSxkdXAyIC0tIGJhc2ggLi9oZXJlX2RvY19kaXN4LnNoICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAKIyBoZXJlX2RvY19kaXN4LnNoOgojIGNhdCAvZGV2L2ZkLzAgPDxc
RU9GCiMgSGVsbG8sIHdvcmxkIQojIEVPRgoKZXhlY3ZlKCIvdXNyL2Jpbi9i
YXNoIiwgWyJiYXNoIiwgIi4vaGVyZV9kb2NfZGlzeC5zaCJdLCAweDdmZmNh
YTFiNjM4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vc2UoMSkgICAgICAgICAgICAgICAgICAgID0g
MApbcGlkICAxNjgxXSBjbG9zZSgyKSAgICAgICAgICAgICAgICAgICAgPSAw
CltwaWQgIDE2ODFdICsrKyBleGl0ZWQgd2l0aCAwICsrKwotLS0gU0lHQ0hM
RCB7c2lfc2lnbm89U0lHQ0hMRCwgc2lfY29kZT1DTERfRVhJVEVELCBzaV9w
aWQ9MTY4MSwgc2lfdWlkPTEwMDAsIHNpX3N0YXR1cz0wLCBzaV91dGltZT0w
LCBzaV9zdGltZT0wfSAtLS0KcmVhZCgyNTUsICIiLCAzOSkgICAgICAgICAg
ICAgICAgICAgICAgID0gMAorKysgZXhpdGVkIHdpdGggMCArKysKQEAgCgoj
PT09PT0K


--=_2e34055594bb021ed7baf8a5a30c16cb
Content-Type: text/plain; charset=us-ascii


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

- Raw text -


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