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