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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=wZd/JmdzGPrXExFKU0W8PFS2WcIrOI5uDEd6nzWsh3TPzxoOg0MAx nw5BnH3e0YxNw61tIsDT9xykjPsbhJaKqCBd89w8u86939bO3985wp3QbnsLgnj1 34uiwmX8EmtPJhpnX9N+frwmHZ1b8wKLTYSo4sfzGRfHSk66a5EVT0= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=l5e7gpto6sTwtQnMPj3j6bsbwxw=; b=ZmR0mnrJK6vdinOAIUbGfpvdP0kI cX5stkQQfWbzFd62s4zklAeWl1o4sJm3wBPm57XQq/mPuEGEgmYMbvhX5F7WwOzi qsDcsFNv3dMImJTSwpEHEcNW9ilT443YQjL8jWsp95QPDAcfc5UYHjiKz+Yk9TCf +MXD2wvUp3h9eNg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-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 Date: Sun, 16 Dec 2018 22:55:49 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT 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 AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <0f030e809f063f5a5e64ff7a7a0c3227 AT xs4all DOT nl> <20181216202847 DOT GK28727 AT calimero DOT vinschen DOT 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) --DO5DiztRLs659m5i Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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" -----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--