| Main index | Section 9 | Options |
#include <sys/param.h>
#include <sys/vnode.h>
This process is necessarily unreliable for several reasons: intermediate entries in the path may not be found in the cache; files may have more than one name (hard links), not all file systems use the name cache (specifically, most synthetic file systems do not); a single name may be used for more than one file (in the context of file systems covering other file systems); a file may have no name (if deleted but still open or referenced). However, the resulting string may still be more useable to a user than a vnode pointer value, or a device number and inode number. Code consuming the results of this function should anticipate (and properly handle) failure.
Its arguments are:
| vp | |
| The vnode to search for. No need to be locked by the caller. | |
| retbuf | |
| Pointer to a char * that vn_fullpath() may (on success) point at a newly allocated buffer containing the resulting pathname. | |
| freebuf | |
| Pointer to a char * that vn_fullpath() may (on success) point at a buffer to be freed, when the caller is done with retbuf. | |
Typical consumers will declare two character pointers: fullpath and freepath; they will set freepath to NULL, and fullpath to a name to use in the event that the call to vn_fullpath() fails. After done with the value of fullpath, the caller will check if freepath is non- NULL, and if so, invoke free(9) with a pool type of M_TEMP.
| VN_FULLPATH (9) | June 15, 2021 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
