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
45 .Fa "struct statvfs *buf"
49 .Fa "const char *restrict path"
50 .Fa "struct statvfs *restrict buf"
57 functions attempt to fill the structure pointed to by
60 statistics, but portable applications must not depend on this.
61 Applications must pass a pathname or file descriptor which refers to a
62 file on the file system in which they are interested.
66 structure contains the following members:
67 .Bl -tag -offset indent -width ".Va f_namemax"
69 The maximum length in bytes of a file name on this file system.
70 Applications should use
74 Not meaningful in this implementation.
76 The size in bytes of the minimum unit of allocation on this
78 (This corresponds to the
81 .Vt "struct statfs" . )
83 The preferred length of I/O requests for files on this file system.
87 .Vt "struct statfs" . )
89 Flags describing mount options for this file system; see below.
92 In addition, there are three members of type
94 which represent counts of file serial numbers
96 inodes); these are named
97 .Va f_files , f_favail ,
100 and represent the number of file serial numbers which exist in total,
101 are available to unprivileged processes, and are available to
102 privileged processes, respectively.
103 Likewise, the members
104 .Va f_blocks , f_bavail ,
109 represent the respective allocation-block counts.
111 There are two flags defined for the
114 .Bl -tag -offset indent -width ".Dv ST_NOSUID"
116 The file system is mounted read-only.
123 are not supported by, or are disabled on, this file system.
125 .Sh IMPLEMENTATION NOTES
130 functions are implemented as wrappers around the
134 functions, respectively.
135 Not all the information provided by those functions is made available
136 through this interface.
138 .Rv -std statvfs fstatvfs
142 function fails if one or more of the following are true:
145 Search permission is denied for a component of the path prefix of
151 points to an invalid address.
155 error occurred while reading from or writing to the file system.
157 Too many symbolic links were encountered in translating
159 .It Bq Er ENAMETOOLONG
160 The length of a component of
164 characters, or the length of
170 The file referred to by
174 A component of the path prefix of
181 functions fails if one or more of the following are true:
185 is not a valid open file descriptor.
188 points to an invalid address.
192 error occurred while reading from or writing to the file system.
203 As standardized, portable applications cannot depend on these functions
204 returning any valid information at all.
205 This implementation attempts to provide as much useful information as
206 is provided by the underlying file system, subject to the limitations
207 of the specified data types.
213 manual page was originally written by
214 .An Garrett Wollman Aq wollman@FreeBSD.org .