xref: /netbsd-src/share/man/man9/vattr.9 (revision 05859157e6397edc63b68f9cbff294ac7b3790e4)
1.\"     $NetBSD: vattr.9,v 1.15 2010/12/02 12:54:13 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.\"
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 8, 2010
31.Dt VATTR 9
32.Os
33.Sh NAME
34.Nm vattr ,
35.Nm vattr_null
36.Nd vnode attributes
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/vnode.h
40.Ft void
41.Fn vattr_null "struct vattr *vap"
42.Sh DESCRIPTION
43Vnode attributes describe attributes of a file or directory including
44file permissions, owner, group, size, access time and modification time.
45.Pp
46A vnode attribute has the following structure:
47.Pp
48.Bd -literal
49struct vattr {
50        enum vtype      va_type;        /* vnode type (for create) */
51        mode_t          va_mode;        /* files access mode and type */
52        nlink_t         va_nlink;       /* number of references to file */
53        uid_t           va_uid;         /* owner user id */
54        gid_t           va_gid;         /* owner group id */
55        dev_t           va_fsid;        /* file system id (dev for now) */
56        ino_t           va_fileid;      /* file id */
57        u_quad_t        va_size;        /* file size in bytes */
58        long            va_blocksize;   /* blocksize preferred for i/o */
59        struct timespec va_atime;       /* time of last access */
60        struct timespec va_mtime;       /* time of last modification */
61        struct timespec va_ctime;       /* time file changed */
62        struct timespec va_birthtime;   /* time file created */
63        u_long          va_gen;         /* generation number of file */
64        u_long          va_flags;       /* flags defined for file */
65        dev_t           va_rdev;        /* device the special file represents */
66        u_quad_t        va_bytes;       /* bytes of disk space held by file */
67        u_quad_t        va_filerev;     /* file modification number */
68        u_int           va_vaflags;     /* operations flags, see below */
69        long            va_spare;       /* remain quad aligned */
70};
71.Ed
72.Pp
73A field value of VNOVAL represents a field whose value is unavailable
74or which is not to be changed.
75Valid flag values for
76.Em va_flags
77are:
78.Pp
79.Bl -tag -offset indent -width VA_UTIMES_NULL -compact
80.It VA_UTIMES_NULL
81utimes argument was NULL
82.It VA_EXCLUSIVE
83exclusive create request
84.El
85.Pp
86Vnode attributes for a file are set by the vnode operation
87.Xr VOP_SETATTR 9 .
88Vnode attributes for a file are retrieved by the vnode operation
89.Xr VOP_GETATTR 9 .
90For more information on vnode operations see
91.Xr vnodeops 9 .
92.Sh FUNCTIONS
93.Bl -tag -width compact
94.It Fn vattr_null "vap"
95Set vnode attributes in
96.Fa vap
97to VNOVAL.
98.El
99.Sh CODE REFERENCES
100.Fn vattr_null
101is implemented in
102.Pa sys/kern/vfs_subr.c .
103.Sh SEE ALSO
104.Xr intro 9 ,
105.Xr vfs 9 ,
106.Xr vnode 9 ,
107.Xr vnodeops 9
108