From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88831 invoked by alias); 17 Dec 2018 04:30:59 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 69977 invoked by uid 89); 17 Dec 2018 04:30:41 -0000 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 Received: from lb1-smtp-cloud8.xs4all.net (HELO lb1-smtp-cloud8.xs4all.net) (194.109.24.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Dec 2018 04:30:38 +0000 Received: from webmail.xs4all.nl ([IPv6:2001:888:0:22:194:109:20:195]) by smtp-cloud8.xs4all.net with ESMTPA id YkXygUJFBAdxGYkXygom38; Mon, 17 Dec 2018 05:30:26 +0100 Received: from a83-162-234-136.adsl.xs4all.nl ([83.162.234.136]) by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Mon, 17 Dec 2018 05:30:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 17 Dec 2018 04:30:00 -0000 From: Houder 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> <20181216215549.GO28727@calimero.vinschen.de> Message-ID: <12270f528754c1ce974e6ad8d22c4249@xs4all.nl> X-Sender: houder@xs4all.nl User-Agent: XS4ALL Webmail X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00132.txt.bz2 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