*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: vn_fullpath | Section: 9 | Source: FreeBSD | File: vn_fullpath.9.gz
VN_FULLPATH(9) FreeBSD Kernel Developer's Manual VN_FULLPATH(9) NAME vn_fullpath - convert a vnode reference to a full pathname, given a process context SYNOPSIS #include <sys/param.h> #include <sys/vnode.h> int vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf); DESCRIPTION The vn_fullpath() function makes a "best effort" attempt to generate a string pathname for the passed vnode; the resulting path, if any, will be relative to the root directory of the process associated with the passed thread pointer. The vn_fullpath() function is implemented by inspecting the VFS name cache, and attempting to reconstruct a path from the process root to the object. 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. RETURN VALUES If the vnode is successfully converted to a pathname, 0 is returned; otherwise, an error number is returned. SEE ALSO free(9) AUTHORS This manual page was written by Robert Watson <[email protected]>. FreeBSD 14.1-RELEASE-p8 June 15, 2021 FreeBSD 14.1-RELEASE-p8

Navigation Options