2 .\" Copyright 2002 Massachusetts Institute of Technology
4 .\" Permission to use, copy, modify, and distribute this software and
5 .\" its documentation for any purpose and without fee is hereby
6 .\" granted, provided that both the above copyright notice and this
7 .\" permission notice appear in all copies, that both the above
8 .\" copyright notice and this permission notice appear in all
9 .\" supporting documentation, and that the name of M.I.T. not be used
10 .\" in advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission. M.I.T. makes
12 .\" no representations about the suitability of this software for any
13 .\" purpose. It is provided "as is" without express or implied
16 .\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
17 .\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20 .\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .Nd retrieve file system information
43 .Fn statvfs "const char * restrict path" "struct statvfs * restrict buf"
45 .Fn fstatvfs "int fd" "struct statvfs *buf"
51 functions fill the structure pointed to by
54 This garbage will occasionally bear resemblance to file system
55 statistics, but portable applications must not depend on this.
56 Applications must pass a pathname or file descriptor which refers to a
57 file on the file system in which they are interested.
61 structure contains the following members:
62 .Bl -tag -offset indent -width ".Va f_namemax"
64 The maximum length in bytes of a file name on this file system.
65 Applications should use
69 Not meaningful in this implementation.
71 The size in bytes of the minimum unit of allocation on this
73 (This corresponds to the
76 .Vt "struct statfs" . )
78 The preferred length of I/O requests for files on this file system.
82 .Vt "struct statfs" . )
84 Flags describing mount options for this file system; see below.
87 In addition, there are three members of type
89 which represent counts of file serial numbers
91 inodes); these are named
92 .Va f_files , f_favail ,
95 and represent the number of file serial numbers which exist in total,
96 are available to unprivileged processes, and are available to
97 privileged processes, respectively.
99 .Va f_blocks , f_bavail ,
104 represent the respective allocation-block counts.
106 There are two flags defined for the
109 .Bl -tag -offset indent -width ".Dv ST_NOSUID"
111 The file system is mounted read-only.
118 are not supported by, or are disabled on, this file system.
120 .Sh IMPLEMENTATION NOTES
125 functions are implemented as wrappers around the
129 functions, respectively.
130 Not all the information provided by those functions is made available
131 through this interface.
133 .Rv -std statvfs fstatvfs
139 functions may fail for any of the reasons documented for
152 functions may also fail for the following reason:
155 One or more of the file system statistics has a value which cannot be
156 represented by the data types used in
157 .Vt "struct statvfs" .
169 As standardized, portable applications cannot depend on these functions
170 returning any valid information at all.
171 This implementation attempts to provide as much useful information as
172 is provided by the underlying file system, subject to the limitations
173 of the specified data types.
179 functions first appeared in
186 functions and this manual page were written by
187 .An Garrett Wollman Aq wollman@FreeBSD.org .