Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Apropos / Subsearch:
optional field

VOP_GETATTR(9)           BSD Kernel Developer's Manual          VOP_GETATTR(9)

     VOP_GETATTR, VOP_SETATTR -- get or set vnode attributes

     #include <&lt;sys/vnode.h>&gt;

     VOP_GETATTR(struct vnode *vp, struct vattr *vap, struct ucred *cred,
         struct proc *p);

     VOP_SETATTR(struct vnode *vp, struct vattr *vap, struct ucred *cred,
         struct proc *p);

     The VOP_GETATTR and VOP_SETATTR routines implement a generic way of rep-
     resenting, retrieving, and setting many vnode attributes such as size,
     number of references, access mode, and last modified time.  All
     attributes are held in the vattr structure described below.

     struct vattr {
             enum vtype      va_type;        /* vnode type */
             mode_t          va_mode;        /* files access mode and type */
             nlink_t         va_nlink;       /* number of references */
             uid_t           va_uid;         /* owner user id */
             gid_t           va_gid;         /* owner group id */
             long            va_fsid;        /* file system id */
             long            va_fileid;      /* file id */
             u_quad_t        va_size;        /* file size in bytes */
             long            va_blocksize;   /* blocksize preferred for i/o */
             struct timespec va_atime;       /* time of last access */
             struct timespec va_mtime;       /* time of last modification */
             struct timespec va_ctime;       /* time file changed */
             u_long          va_gen;         /* generation number of file */
             u_long          va_flags;       /* flags defined for file */
             dev_t           va_rdev;        /* device the vnode represents */
             u_quad_t        va_bytes;       /* bytes of held disk space */
             u_quad_t        va_filerev;     /* file modification number */
             u_int           va_vaflags;     /* operations flags */
             long            va_spare;       /* remain quad aligned */

     Depending on the specific filesystem implementation, some values may not
     be available for modification and/or retrieval.  In these cases, the cor-
     responding fields in the vattr structure should be set to VNOVAL.

     Upon return from a VOP_GETATTR() call made on a directory, the va_nlink
     field should contain the number of entries in the directory, if possible,
     or 1 otherwise.

     The VOP_GETATTR() and VOP_SETATTR() functions return 0 to indicate suc-
     cess and a non-zero error code to indicate failure.  See errno(2) for
     more information.

     errno(2), vfs(9), vn_stat(9), vnode(9)

     This man page was written by Pedro Martelletto for OpenBSD.

BSD                              June 4, 2013                              BSD