Gets the attributes of a file.
Item | Description |
---|---|
vp | Specifies the virtual node (v-node) of the file system object. |
vap | Points to a vattr structure. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vnop_getattr entry point is called by the logical file system to retrieve information about a file. The vattr structure indicated by the vap parameter contains all the relevant attributes of the file. The vattr structure is defined in the /usr/include/sys/vattr.h file. This entry point is used to implement the stat, fstat, and lstat subroutines.
The vnop_getattr entry point can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.