delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/16/23:31:14

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
:content-transfer-encoding:date:from:to:subject:in-reply-to
:references:message-id; q=dns; s=default; b=qpjLEFkzClPtQrV9whmY
sHoe3vWUpeL80M2tNNxnXkILDhaM9FN5ezg+VzcEbsWCwhtLK8Ro6xVoJGt2afwo
3rKhsW5nLm4uzr57GahBrQSdun38Wnfff54focFGfju9LyyjIIjCW8nGvjUABirF
1Y9YepxLMOuq+wwtWpGAzkQ=
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
:content-transfer-encoding:date:from:to:subject:in-reply-to
:references:message-id; s=default; bh=YdtgO36vLgo3a4UL0ZKj88weeY
M=; b=urKBFFs18lNzjS4Dco0RLenrrbBDnJi8yxsdjKd6Al1zDSoK9p6jowMf+Y
gF6KSDQXKu4D3NQU22oevfEVj95aDieLlAmYRZpn9Gmz7JG7EFzsyF2oXt1jm0Wu
/hYR5kNwcGHcn42dkuJ6NjwFc94Ms7spRxzePFjuNAAPSMHBc=
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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:US-ASCII, H*F:D*nl, Hx-spam-relays-external:sk:webmail, H*RU:sk:webmail
X-HELO: lb1-smtp-cloud8.xs4all.net
MIME-Version: 1.0
Date: Mon, 17 Dec 2018 05:30:26 +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: <20181216215549.GO28727@calimero.vinschen.de>
References: <0f030e809f063f5a5e64ff7a7a0c3227 AT xs4all DOT nl> <20181216202847 DOT GK28727 AT calimero DOT vinschen DOT de> <CAHSx_SvqFgi5stKvYSNCPwyyu98miPHyYcDKJL1-=KP8NE9+JQ AT mail DOT gmail DOT com> <20181216215549 DOT GO28727 AT calimero DOT vinschen DOT de>
Message-ID: <12270f528754c1ce974e6ad8d22c4249@xs4all.nl>
X-Sender: houder AT xs4all DOT nl
User-Agent: XS4ALL Webmail
X-IsSubscribed: yes

On 2018-12-16 22:55, Corinna Vinschen wrote:
[snip]

> I'm mulling over adding some hack to open().  It could try to recognize
> the special case of opening a processes' own descriptor symlink within
> /proc and then warp the open() call into dup().  No idea how tricky
> or even feasible that is, though...

That is why I wrote the following in my STC:

         // Q: does Cygwin attempt to read the /tmp directory? (an 
attempt that
         //    will fail, because the file has been unlinked)
         // it appears that reading a symlnk in /dev/fd can best be 
diverted to
         // the open file descriptor of the process ...

What I meant was, that I see no reason to modify the symlink in this
special case, but in stead of that to access the file using fd N, where
N is equal to the one in /dev/fd/N.

File descriptor N has been left open by bash and should not have been
closed as result of the exec ...

And indeed, I have _no_ clue if the above is feasible (and tricky?) in
Cygwin; otherwise I would have posted a solution.

Regards,
Henri

--
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

- Raw text -


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