From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72017 invoked by alias); 16 Dec 2018 21:36:28 -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 72006 invoked by uid 89); 16 Dec 2018 21:36:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:ESMTPA X-HELO: bird.maple.relay.mailchannels.net Received: from bird.maple.relay.mailchannels.net (HELO bird.maple.relay.mailchannels.net) (23.83.214.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Dec 2018 21:36:26 +0000 X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B171868262B for ; Sun, 16 Dec 2018 21:36:23 +0000 (UTC) Received: from pdx1-sub0-mail-a27.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7DF2D6827F1 for ; Sun, 16 Dec 2018 21:36:23 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net Received: from pdx1-sub0-mail-a27.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 16 Dec 2018 21:36:23 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dropbox@opencoder.net X-MailChannels-Auth-Id: dreamhost X-Abaft-Imminent: 59ee3ac36116fec8_1544996183589_3431043853 X-MC-Loop-Signature: 1544996183589:2133734616 X-MC-Ingress-Time: 1544996183589 Received: from pdx1-sub0-mail-a27.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTP id 47A3C80681 for ; Sun, 16 Dec 2018 13:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opencoder.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type; s=opencoder.net; bh=tOn4MwbGY7sxxdGrEOnkwas0rA k=; b=IQ0wLsE/R/0ScmFnR6+Vk5vCG9XL+NEckgVC127uR2LJ8HAYT7qln68Jmc XgmhJ6bWo20zPwlIuSVCb3daOYFMtO5f3iV5ZQ/ahkoilZ/sE723/pYWYwKZq6ul PeqKfHyYQAXZYym0MbpPXA1cdSTwB7zcSOhzPmGLQA2LKfaEM= Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dropbox@opencoder.net) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTPSA id 2216480672 for ; Sun, 16 Dec 2018 13:36:22 -0800 (PST) Received: by mail-ot1-f51.google.com with SMTP id 81so10414646otj.2 for ; Sun, 16 Dec 2018 13:36:21 -0800 (PST) MIME-Version: 1.0 References: <0f030e809f063f5a5e64ff7a7a0c3227@xs4all.nl> <20181216202847.GK28727@calimero.vinschen.de> In-Reply-To: <20181216202847.GK28727@calimero.vinschen.de> X-DH-BACKEND: pdx1-sub0-mail-a27 From: Wayne Davison Date: Sun, 16 Dec 2018 21:36:00 -0000 Message-ID: Subject: Re: /dev/fd/N not synonymous with file descriptor N; it is on Linux To: cygwin Content-Type: text/plain; charset="UTF-8" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudehledgudehvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjgfhfffkuffvtgesthdtredttddtjeenucfhrhhomhephggrhihnvgcuffgrvhhishhonhcuoeifrgihnhgvsehophgvnhgtohguvghrrdhnvghtqeenucfkphepvddtledrkeehrddvuddtrdehudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlqdhothduqdhfhedurdhgohhoghhlvgdrtghomhdpihhnvghtpedvtdelrdekhedrvddutddrhedupdhrvghtuhhrnhdqphgrthhhpeghrgihnhgvucffrghvihhsohhnuceofigrhihnvgesohhpvghntghouggvrhdrnhgvtheqpdhmrghilhhfrhhomhepfigrhihnvgesohhpvghntghouggvrhdrnhgvthdpnhhrtghpthhtoheptgihghifihhnsegthihgfihinhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00129.txt.bz2 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. 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. > The way it's implemented in Cygwin uses the actual file path resolution and then either works or fails as above. 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 (note the dot-fd) before creating the normal fd/0 symlink. Then, when a request came in to read /proc/$PID/fd/0, it could check if the associated hard-link exists and read from that instead. Or perhaps the "symlink" info could be stored elsewhere and the fd/0 file could be the hard-link, requiring the stat code to be tweaked to look up the pretend-symlink info? ..wayne.. -- 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