1 .\" $NetBSD: statvfs.5,v 1.10 2008/06/23 04:22:36 dholland Exp $
3 .\" Copyright (c) 1989, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)statfs.2 8.5 (Berkeley) 5/24/95
37 .Nd file system statistics
44 header defines the structures and functions that
45 return information about a mounted file system.
48 structure is defined as follows:
50 typedef struct { int32_t val[2]; } fsid_t; /* file system id type */
52 #define VFS_NAMELEN 32 /* length of fs type name, including nul */
53 #define VFS_MNAMELEN 1024 /* length of buffer for returned name */
56 unsigned long f_flag; /* copy of mount exported flags */
57 unsigned long f_bsize; /* system block size */
58 unsigned long f_frsize; /* system fragment size */
59 unsigned long f_iosize; /* optimal file system block size */
61 fsblkcnt_t f_blocks; /* number of blocks in file system */
62 fsblkcnt_t f_bfree; /* free blocks avail in file system */
63 fsblkcnt_t f_bavail; /* free blocks avail to non-root */
64 fsblkcnt_t f_bresvd; /* blocks reserved for root */
66 fsfilcnt_t f_files; /* total file nodes in file system */
67 fsfilcnt_t f_ffree; /* free file nodes in file system */
68 fsfilcnt_t f_favail; /* free file nodes avail to non-root */
69 fsfilcnt_t f_fresvd; /* file nodes reserved for root */
71 uint64_t f_syncreads; /* count of sync reads since mount */
72 uint64_t f_syncwrites; /* count of sync writes since mount */
74 uint64_t f_asyncreads; /* count of async reads since mount */
75 uint64_t f_asyncwrites; /* count of async writes since mount */
77 unsigned long f_fsid; /* POSIX compliant file system id */
78 fsid_t f_fsidx; /* NetBSD compatible file system id */
80 unsigned long f_namemax;/* maximum filename length */
81 uid_t f_owner; /* user that mounted the file system */
83 uint32_t f_spare[4]; /* spare space */
85 char f_fstypename[VFS_NAMELEN]; /* fs type name */
86 char f_mntonname[VFS_MNAMELEN]; /* directory on which mounted */
87 char f_mntfromname[VFS_MNAMELEN]; /* mounted file system */
93 argument can have the following bits set:
94 .Bl -tag -width ST_SYNCHRONOUS
96 The filesystem is mounted read-only;
97 Even the super-user may not write on it.
99 Files may not be executed from the filesystem.
101 Setuid and setgid bits on files are not honored when they are executed.
103 Special files in the filesystem may not be opened.
105 Union with underlying filesystem instead of obscuring it.
106 .It Dv ST_SYNCHRONOUS
107 All I/O to the filesystem is done synchronously.
109 No filesystem I/O is done synchronously.
111 Don't write core dumps to this file system.
113 Never update access times.
115 Recognize symbolic link permission.
117 Never update modification times for device files.
119 Use logging (journalling).
121 The filesystem resides locally.
123 The filesystem has quotas enabled on it.
125 Identifies the root filesystem.
127 The filesystem is exported read-only.
129 The filesystem is exported for both reading and writing.
130 .It Dv ST_DEFEXPORTED
131 The filesystem is exported for both reading and writing to any Internet host.
133 The filesystem maps all remote accesses to the anonymous user.
135 The filesystem is exported with Kerberos uid mapping.
136 .It Dv ST_EXNORESPORT
137 Don't enforce reserved ports (NFS).
139 Public export (WebNFS).
142 Fields that are undefined for a particular file system are set to \-1.
144 .Bl -tag -width f_bavail
148 field is the same as the
157 by the X/Open standard.
158 Unfortunately this is not enough space to store our
160 so we define an additional
164 Could historically be negative (in the
166 system call) when the used space has exceeded
167 the non-superuser free space.
168 In order to comply with the X/Open standard, we have to define
170 as an unsigned type, so in all cases where
172 would have been negative, we set it to 0.
173 In addition we provide
175 which contains the amount of reserved blocks for the superuser, so
178 can be easily computed as:
180 old_bavail = f_bfree - f_bresvd;
188 header first appeared in