How to get filename of an open file descriptor

Yuri yuri at rawbw.com
Mon Nov 12 12:47:23 PST 2007


I am looking for functionality similar to Linux's /proc/<PID>/fd/<FD>.
I need to know what is the file name of an open file descriptor.

/proc/<PID>/fd is missing on FreeBSD.

There's something called 'fdescfs'. In /dev/fd/ it shows the list of file
descriptors. But they don't seem to be symbolic links to open files. And also it
only shows FDs of the current process.

So why there's no /proc/<PID>/fd in FreeBSD?
And how do I work around this?
Or should I just invest time and write a kernel patch implementing /proc/<PID>/fd/?

Yuri


More information about the freebsd-hackers mailing list