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
29 .\" $FreeBSD: src/lib/libc/gen/statvfs.3,v 1.7 2003/06/08 10:01:51 charnier Exp $
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 attempt to fill the structure pointed to by
54 statistics, but portable applications must not depend on this.
55 Applications must pass a pathname or file descriptor which refers to a
56 file on the file system in which they are interested.
60 structure contains the following members:
61 .Bl -tag -offset indent -width ".Va f_namemax"
63 The maximum length in bytes of a file name on this file system.
64 Applications should use
68 Not meaningful in this implementation.
70 The size in bytes of the minimum unit of allocation on this
72 (This corresponds to the
75 .Vt "struct statfs" . )
77 The preferred length of I/O requests for files on this file system.
81 .Vt "struct statfs" . )
83 Flags describing mount options for this file system; see below.
86 In addition, there are three members of type
88 which represent counts of file serial numbers
90 inodes); these are named
91 .Va f_files , f_favail ,
94 and represent the number of file serial numbers which exist in total,
95 are available to unprivileged processes, and are available to
96 privileged processes, respectively.
98 .Va f_blocks , f_bavail ,
103 represent the respective allocation-block counts.
105 There are two flags defined for the
108 .Bl -tag -offset indent -width ".Dv ST_NOSUID"
110 The file system is mounted read-only.
117 are not supported by, or are disabled on, this file system.
119 .Sh IMPLEMENTATION NOTES
124 functions are implemented as wrappers around the
128 functions, respectively.
129 Not all the information provided by those functions is made available
130 through this interface.
132 .Rv -std statvfs fstatvfs
136 function fails if one or more of the following are true:
139 A component of the path prefix of
142 .It Bq Er ENAMETOOLONG
143 The length of a component of
147 characters, or the length of
153 The file referred to by
157 Search permission is denied for a component of the path prefix of
160 Too many symbolic links were encountered in translating
166 points to an invalid address.
170 error occurred while reading from or writing to the file system.
175 functions fails if one or more of the following are true:
179 is not a valid open file descriptor.
182 points to an invalid address.
186 error occurred while reading from or writing to the file system.
197 As standardized, portable applications cannot depend on these functions
198 returning any valid information at all.
199 This implementation attempts to provide as much useful information as
200 is provided by the underlying file system, subject to the limitations
201 of the specified data types.
207 manual page was originally written by
208 .An Garrett Wollman Aq wollman@FreeBSD.org .