X-Recipient: archive-cygwin@delorie.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit
Date: Mon, 17 Dec 2018 05:30:26 +0100
From: Houder <houder@xs4all.nl>
To: cygwin@cygwin.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@xs4all.nl> <20181216202847.GK28727@calimero.vinschen.de> <CAHSx_SvqFgi5stKvYSNCPwyyu98miPHyYcDKJL1-=KP8NE9+JQ@mail.gmail.com> <20181216215549.GO28727@calimero.vinschen.de>
Message-ID: <12270f528754c1ce974e6ad8d22c4249@xs4all.nl>
X-Sender: houder@xs4all.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

