how can i get file name knowing its descriptor?

Peter Jeremy peterjeremy at optushome.com.au
Fri Jul 4 09:26:13 UTC 2008


On 2008-Jul-03 14:08:12 +0300, Uladzislau Rezki <urezki at gmail.com> wrote:
>I've been writing a small kernel module, that provides information about
>modification of the filesystem to user_land/userspace through the
>character device. I'm using FreeBSD 4.10

4.10 has not been supported for several years now.  I strongly recommend
you look at upgrading to at least 6.3.

>So, my question is: Is there any way to get file name knowing its descriptor?

The simple answer is no.  That said, you could try having a look at
how lsof works (whilst it runs in userland, it needs to grovel around
in the kernel datastructures much the same as your module would need to.

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20080704/84ce980a/attachment.pgp


More information about the freebsd-hackers mailing list