Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2020 20:53:00 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        Yuri <yuri@rawbw.com>, 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:  <20200708175300.GA2866@kib.kiev.ua>
In-Reply-To: <CAGudoHHpaKEo9ZfHEGrRgLE6RknM_KbmN1B5cx2%2B6jNsDzgY1A@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 08, 2020 at 07:22:10PM +0200, Mateusz Guzik wrote:
> llvm is an example reason why I'm reluctant to add this. llvm
> currently will perform realpath, which was converted to a syscall and
> with other upcoming changed will be quite cheap, but most importantly
> reliable. F_GETPATH can easily fail which makes me really wary of this
> without always adding names to the namecache.

I think an immediately useful addition would be a sysctl or fcntl that
return struct kinfo_file for single file descriptor.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200708175300.GA2866>