| Main index | Section 9 | Options |
#include <sys/param.h>
#include <sys/vnode.h>
VOP_STAT() returns data in a format suitable for the stat(2) system call and by default is implemented as a wrapper around VOP_GETATTR(). Filesystems may want to implement their own variant for performance reasons.
For VOP_GETATTR() and VOP_SETATTR() the arguments are:
| vp | |
| The vnode of the file. | |
| vap | |
| The attributes of the file. | |
| cred | |
| The user credentials of the calling thread. | |
For VOP_STAT() the arguments are:
| vp | |
| The vnode of the file. | |
| sb | |
| The attributes of the file. | |
| active_cred | |
| The user credentials of the calling thread. | |
| file_cred | |
| The credentials installed on the file description pointing to the vnode or NOCRED. | |
| td | |
| The calling thread. | |
Attributes which are not being modified by VOP_SETATTR() should be set to the value VNOVAL; VATTR_NULL() may be used to clear all the values, and should generally be used to reset the contents of *vap prior to setting specific values.
VOP_SETATTR() expects the vnode to be locked on entry and will leave the vnode locked on return. The lock type must be exclusive.
| [EPERM] | |
| The file is immutable. | |
| [EACCES] | |
| The caller does not have permission to modify the file or directory attributes. | |
| [EROFS] | |
| The file system is read-only. | |
| VOP_ATTRIB (9) | August 8, 2020 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
