DTrace provides an array for userland processes, fds[], which allows mapping file descriptors to a fileinfo_t structure, which can then be used to get information about that file. This does not seem to be documented anywhere in the DTrace guide, currently.