From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:40:04 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD55E367302 for ; Wed, 8 Jul 2020 16:40:04 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [107.204.234.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B24m32x74z4GsJ for ; Wed, 8 Jul 2020 16:40:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id 068GdutK039874; Wed, 8 Jul 2020 16:39:56 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id 068Gduah039873; Wed, 8 Jul 2020 09:39:56 -0700 (PDT) (envelope-from david) Date: Wed, 8 Jul 2020 09:39:56 -0700 From: David Wolfskill To: Yuri Cc: Freebsd hackers list Subject: Re: Is it possible to determine the open file path based on the file descriptor? Message-ID: <20200708163956.GO1462@albert.catwhisker.org> Reply-To: hackers@freebsd.org Mail-Followup-To: hackers@freebsd.org, Yuri , Freebsd hackers list References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3EG2G0wNthkGfxoY" Content-Disposition: inline In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> X-Rspamd-Queue-Id: 4B24m32x74z4GsJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of david@catwhisker.org designates 107.204.234.170 as permitted sender) smtp.mailfrom=david@catwhisker.org X-Spamd-Result: default: False [-3.58 / 15.00]; HAS_REPLYTO(0.00)[hackers@freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.951]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:107.204.234.170]; NEURAL_HAM_LONG(-1.04)[-1.041]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; SUBJECT_ENDS_QUESTION(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[catwhisker.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.19)[-0.191]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:7018, ipnet:107.192.0.0/12, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:40:04 -0000 --3EG2G0wNthkGfxoY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2020 at 09:22:14AM -0700, Yuri wrote: > Hi Hackers, >=20 >=20 > One of the ports (sysutils/watchman) attempts to find the path of the=20 > file based on the file descriptor assuming that this descriptor=20 > represents an open file. >=20 >=20 > Is this possible? > .... Not really. For one thing, the concept will be dependent on the design and implementation of the file system, and in common cases (e.g., UFS), there's no guarantee that a particular path is unique (as a given file may have multiple links); there may also be symlinks, and an intermediate node (directory) could be renamed at any point. iAnd I'm sure there are other considerations that don't immediately come to mind. Peace, david --=20 David H. Wolfskill david@catwhisker.org I'd far sooner question Donald Trump's loyalty to the US than Tammy Duckwor= th's. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --3EG2G0wNthkGfxoY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl8F9txfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PckkoQgAoGDAxQIrEI320H9dtQGBcjyw/B4DSOwLfa9VisAi+OlIW9/rrR0/KmEe qVz9jLIYi/tvth1Wgoq5w1hKKDcHzpMAvzyiJ2RqZB8mO0cxys10AIE52eiX30Xd F8uDCl0tRBS5ssuHNUq1+atYxXMirGWnnmEvEnsbEWzxFLNahys/KJWWxD+SLDWa Zo+fiZdKW11QXReHuVXdfQLoF3O4VMsivkkYEmRDu6kJbPJtygksGBMXurGsohWP PWPMqV854wnA4wE2vOK2cl5iuLERg/F/kqHGUBmcja78Vjq0wmlWXsy2zAs8o/Ek ekVw5aWOA4VHDa3Ge5r1NXTajoNOfQ== =OdTf -----END PGP SIGNATURE----- --3EG2G0wNthkGfxoY--