From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87610 invoked by alias); 16 Dec 2018 21:55:55 -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 87590 invoked by uid 89); 16 Dec 2018 21:55:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=borders X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Dec 2018 21:55:53 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MmDAc-1hGXmI2GUi-00iEHx for ; Sun, 16 Dec 2018 22:55:50 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 8C162A803E7; Sun, 16 Dec 2018 22:55:49 +0100 (CET) Date: Sun, 16 Dec 2018 21:55:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: /dev/fd/N not synonymous with file descriptor N; it is on Linux Message-ID: <20181216215549.GO28727@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <0f030e809f063f5a5e64ff7a7a0c3227@xs4all.nl> <20181216202847.GK28727@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DO5DiztRLs659m5i" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-12/txt/msg00130.txt.bz2 --DO5DiztRLs659m5i Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1161 On Dec 16 13:36, Wayne Davison wrote: > On Sun, Dec 16, 2018 at 12:29 PM Corinna Vinschen wrote: > > In contrast to Linux the symlinks are not just faked symlinks with the = underlying OS having direct access to the file descriptors. >=20 > Yeah, Linux is more like a fuse where the open filehandles are used > directly on open, and the stat calls return pretend symlinks with the > lsof info. >=20 > > The way it's implemented in Cygwin uses the actual file path resolution= and then either works or fails as above. >=20 > If Cygwin can't be changed into a fuse idiom, perhaps a hard-link > idiom could be used? For instance, when the /proc/$PID/fd/0 symlink is > being created, the code could try to hard-link the file to > /proc/$PID/.fd/0 first Nice try, but hardlinks don't cross FS borders. /proc is a filesystem on its own with its own inode numbers. 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... Corinna --=20 Corinna Vinschen Cygwin Maintainer --DO5DiztRLs659m5i Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlwWyeUACgkQ9TYGna5E T6DdQRAApfB56g9GKPf55QS/4dWm3MOfGfYijb6JjpN0R/GJk3h+TK8Gs6GkHcrG 6pPTeHXAxqypbgzPAhHxDNM/wKqaLIQVcxs1zBhUezyRQsE+Sr2q99ByOD77hZFz Py6y8zXifBu+QmBTzUWiAkYsD8HmFmgLhmCHd6kwDlIpKqFZ2c89Tm8EobhT3NRb /NIGfxfPHqSgdo+3TD3xxPhijxNMnsHP7KECxOdbVxDS8ToOkc9lULyaNNlnCQkB wJlTTYH4k3I8+Kk9F3L2ZiKnQO8hY/JZjzvDH3+aKOC9fCKtjKeggPNHgg4s8x0i OZN4qTgiStBJUw3eSbK/kfZwrTOA6UtXvNc3yycc8IhmsLfIK4NDNKy0vGdWQ/YB 6uwAkTabbrlGtNWU7iQxD7olupr3XxKcDs4YehNn5ji7gKGpu8jSyKxTtLdctq2d /qm80OpsmfsUQXTRNevdPrmfc5sn8Bc+QHQ3Y799UbZuPcp5p2/BiVSKrwm5iPx3 iDRsntL1vW4nq8HaMs39yBjT3yM05W3zvwF1zlJCATA1UOZKp9m7q4JJfN+Io4Mq yyp0HN2sqMomIIBNUDwPfTrSXQXIWnS3i0bzBNPzk8O1bPH/C5kouXv5cxmwUYng FbEVVvvKgtJoLh+F76HTYGOgLSdBDdM64HdR640ioW6fQ4j642E= =vH+X -----END PGP SIGNATURE----- --DO5DiztRLs659m5i--