Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Dec 2021 09:53:23 -0800
From:      Yuri <yuri@rawbw.com>
To:        Konstantin Belousov <kostikbel@gmail.com>, Mateusz Guzik <mjguzik@gmail.com>
Cc:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: Is it possible to determine the open file path based on the file descriptor?
Message-ID:  <656bf089-bcc9-748a-6db2-52f3707e863c@rawbw.com>
In-Reply-To: <20200708175300.GA2866@kib.kiev.ua>
References:  <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> <CAGudoHEjFvt4nijEUj0FwN0CTYmuxuqvSbiMefTeMvrXeuEkJg@mail.gmail.com> <CAGudoHHE7UcNsT5hB8zRwhjABBCP2-rtFcuHE=dhmPwvf=6XgA@mail.gmail.com> <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> <CAGudoHHpaKEo9ZfHEGrRgLE6RknM_KbmN1B5cx2%2B6jNsDzgY1A@mail.gmail.com> <20200708175300.GA2866@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Yuri





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?656bf089-bcc9-748a-6db2-52f3707e863c>