1.\" $NetBSD: vattr.9,v 1.10 2008/04/30 13:10:59 martin Exp $ 2.\" 3.\" Copyright (c) 2001 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Gregory McGarry. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd January 24, 2008 31.Dt VATTR 9 32.Os 33.Sh NAME 34.Nm vattr , 35.Nm vattr_null , 36.Nm VATTR_NULL 37.Nd vnode attributes 38.Sh SYNOPSIS 39.In sys/param.h 40.In sys/vnode.h 41.Ft void 42.Fn vattr_null "struct vattr *vap" 43.Ft void 44.Fn VATTR_NULL "struct vattr *vap" 45.Sh DESCRIPTION 46Vnode attributes describe attributes of a file or directory including 47file permissions, owner, group, size, access time and modification time. 48.Pp 49A vnode attribute has the following structure: 50.Pp 51.Bd -literal 52struct vattr { 53 enum vtype va_type; /* vnode type (for create) */ 54 mode_t va_mode; /* files access mode and type */ 55 nlink_t va_nlink; /* number of references to file */ 56 uid_t va_uid; /* owner user id */ 57 gid_t va_gid; /* owner group id */ 58 long va_fsid; /* file system id (dev for now) */ 59 long va_fileid; /* file id */ 60 u_quad_t va_size; /* file size in bytes */ 61 long va_blocksize; /* blocksize preferred for i/o */ 62 struct timespec va_atime; /* time of last access */ 63 struct timespec va_mtime; /* time of last modification */ 64 struct timespec va_ctime; /* time file changed */ 65 struct timespec va_birthtime; /* time file created */ 66 u_long va_gen; /* generation number of file */ 67 u_long va_flags; /* flags defined for file */ 68 dev_t va_rdev; /* device the special file represents */ 69 u_quad_t va_bytes; /* bytes of disk space held by file */ 70 u_quad_t va_filerev; /* file modification number */ 71 u_int va_vaflags; /* operations flags, see below */ 72 long va_spare; /* remain quad aligned */ 73}; 74.Ed 75.Pp 76A field value of VNOVAL represents a field whose value is unavailable 77or which is not to be changed. 78Valid flag values for 79.Em va_flags 80are: 81.Pp 82.Bl -tag -offset indent -width VA_UTIMES_NULL -compact 83.It VA_UTIMES_NULL 84utimes argument was NULL 85.It VA_EXCLUSIVE 86exclusive create request 87.El 88.Pp 89Vnode attributes for a file are set by the vnode operation 90.Xr VOP_SETATTR 9 . 91Vnode attributes for a file are retrieved by the vnode operation 92.Xr VOP_GETATTR 9 . 93For more information on vnode operations see 94.Xr vnodeops 9 . 95.Sh FUNCTIONS 96.Bl -tag -width compact 97.It Fn vattr_null "vap" 98Set vnode attributes in 99.Fa vap 100to VNOVAL. 101.It Fn VATTR_NULL "vap" 102This function is an alias for 103.Fn vattr_null . 104.El 105.Sh CODE REFERENCES 106This section describes places within the 107.Nx 108source tree where actual code implementing or using the vnode 109attributes can be found. 110All pathnames are relative to 111.Pa /usr/src . 112.Pp 113The vnode attributes ares implemented within the file 114.Pa sys/kern/vfs_subr2.c . 115.Sh SEE ALSO 116.Xr intro 9 , 117.Xr vfs 9 , 118.Xr vnode 9 , 119.Xr vnodeops 9 120