https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197695

--- Comment #4 from Niall Douglas <s_bugzi...@nedprod.com> ---
It turns out that I was wrong about there being no method of retrieving a
canonical path for an open file descriptor on FreeBSD. There in fact is, and it
is called KERN_PROC_FILEDESC.

Unfortunately, KERN_PROC_FILEDESC is broken for regular files, but not
directories where it works perfectly - even tracking renames and deletions with
ease. The attached test case and its output shows the broken behaviour:

1. Files opened with O_CREAT never get a path. Creating the file, closing it
and opening it again gets the file descriptor its path.

2. As soon as the process does its first rename() all the paths for all the
regular file descriptors get reset to null, but not directory file descriptors.

3. Directory file descriptors work correctly.


This was tested on FreeBSD 10.1 with ZFS on root. Other filing systems may
vary.

Niall

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to