Re: Is it possible to determine the open file path based on the file descriptor?

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Sun, 05 Dec 2021 18:54:36 UTC
On Sun, Dec 05, 2021 at 09:53:23AM -0800, Yuri wrote:
> On 7/8/20 10:53, Konstantin Belousov wrote:
> > I think an immediately useful addition would be a sysctl or fcntl that
> > return struct kinfo_file for single file descriptor.
> 
> 
> There is another project that resolves file descriptors to file names:
> 
> https://github.com/PixarAnimationStudios/USD/blob/release/pxr/base/arch/fileSystem.cpp#L470
> 
> 
> Maybe it makes sense to provide a sysctl or fcntl that would return a list
> of paths for a given file descriptor?
> 
> I opened the PR for this:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260241
> 

https://reviews.freebsd.org/D33277