/proc/curproc/file and the KERN_PROC_PATHNAME sysctl may not return the desired path if there are multiple hardlinks to the file.
Unfortunately we do not yet have a standard interface to obtain this in FreeBSD, but one will be added shortly. I will post a followup change to move to that based on FreeBSD version leaving this as a fallback, and eventually we can leave only that one.