]> git.saurik.com Git - apple/libc.git/blame - emulated/statvfs.3
Libc-1244.1.7.tar.gz
[apple/libc.git] / emulated / statvfs.3
CommitLineData
59e0d9fe
A
1.\"
2.\" Copyright 2002 Massachusetts Institute of Technology
3.\"
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
14.\" warranty.
15.\"
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
27.\" SUCH DAMAGE.
28.\"
29.\" $FreeBSD: src/lib/libc/gen/statvfs.3,v 1.7 2003/06/08 10:01:51 charnier Exp $
30.\"
31.Dd July 13, 2002
32.Dt STATVFS 3
33.Os
34.Sh NAME
224c7076
A
35.Nm fstatvfs ,
36.Nm statvfs
59e0d9fe
A
37.Nd retrieve file system information
38.Sh LIBRARY
39.Lb libc
40.Sh SYNOPSIS
41.In sys/statvfs.h
42.Ft int
224c7076
A
43.Fo fstatvfs
44.Fa "int fildes"
45.Fa "struct statvfs *buf"
46.Fc
59e0d9fe 47.Ft int
224c7076
A
48.Fo statvfs
49.Fa "const char *restrict path"
50.Fa "struct statvfs *restrict buf"
51.Fc
59e0d9fe
A
52.Sh DESCRIPTION
53The
54.Fn statvfs
55and
56.Fn fstatvfs
57functions attempt to fill the structure pointed to by
58.Fa buf
59with file system
60statistics, but portable applications must not depend on this.
61Applications must pass a pathname or file descriptor which refers to a
62file on the file system in which they are interested.
63.Pp
64The
65.Vt statvfs
66structure contains the following members:
67.Bl -tag -offset indent -width ".Va f_namemax"
68.It Va f_namemax
69The maximum length in bytes of a file name on this file system.
70Applications should use
71.Xr pathconf 2
72instead.
73.It Va f_fsid
74Not meaningful in this implementation.
75.It Va f_frsize
76The size in bytes of the minimum unit of allocation on this
77file system.
78(This corresponds to the
79.Va f_bsize
80member of
81.Vt "struct statfs" . )
82.It Va f_bsize
83The preferred length of I/O requests for files on this file system.
84(Corresponds to the
85.Va f_iosize
86member of
87.Vt "struct statfs" . )
88.It Va f_flag
89Flags describing mount options for this file system; see below.
90.El
91.Pp
92In addition, there are three members of type
93.Vt fsfilcnt_t ,
94which represent counts of file serial numbers
95.Em ( i.e. ,
96inodes); these are named
97.Va f_files , f_favail ,
98and
99.Va f_ffree ,
100and represent the number of file serial numbers which exist in total,
101are available to unprivileged processes, and are available to
102privileged processes, respectively.
103Likewise, the members
104.Va f_blocks , f_bavail ,
105and
106.Va f_bfree
107(all of type
108.Vt fsblkcnt_t )
109represent the respective allocation-block counts.
110.Pp
111There are two flags defined for the
112.Va f_flag
113member:
114.Bl -tag -offset indent -width ".Dv ST_NOSUID"
115.It Dv ST_RDONLY
116The file system is mounted read-only.
117.It Dv ST_NOSUID
118The semantics of the
119.Dv S_ISUID
120and
121.Dv S_ISGID
122file mode bits
123are not supported by, or are disabled on, this file system.
124.El
125.Sh IMPLEMENTATION NOTES
126The
127.Fn statvfs
128and
129.Fn fstatvfs
130functions are implemented as wrappers around the
131.Fn statfs
132and
133.Fn fstatfs
134functions, respectively.
135Not all the information provided by those functions is made available
136through this interface.
137.Sh RETURN VALUES
138.Rv -std statvfs fstatvfs
139.Sh ERRORS
140The
141.Fn statvfs
142function fails if one or more of the following are true:
143.Bl -tag -width Er
224c7076
A
144.It Bq Er EACCES
145Search permission is denied for a component of the path prefix of
146.Fa path .
147.It Bq Er EFAULT
148.Fa Buf
149or
150.Fa path
151points to an invalid address.
152.It Bq Er EIO
153An
154.Tn I/O
155error occurred while reading from or writing to the file system.
156.It Bq Er ELOOP
157Too many symbolic links were encountered in translating
158.Fa path .
59e0d9fe
A
159.It Bq Er ENAMETOOLONG
160The length of a component of
161.Fa path
162exceeds
163.Dv {NAME_MAX}
164characters, or the length of
165.Fa path
166exceeds
167.Dv {PATH_MAX}
168characters.
169.It Bq Er ENOENT
170The file referred to by
171.Fa path
172does not exist.
224c7076
A
173.It Bq Er ENOTDIR
174A component of the path prefix of
175.Fa Path
176is not a directory.
59e0d9fe
A
177.El
178.Pp
179The
180.Fn fstatvfs
181functions fails if one or more of the following are true:
182.Bl -tag -width Er
183.It Bq Er EBADF
224c7076 184.Fa fildes
59e0d9fe
A
185is not a valid open file descriptor.
186.It Bq Er EFAULT
187.Fa Buf
188points to an invalid address.
189.It Bq Er EIO
190An
191.Tn I/O
192error occurred while reading from or writing to the file system.
193.El
194.Sh SEE ALSO
195.Xr statfs 2
196.Sh STANDARDS
197The
198.Fn statvfs
199and
200.Fn fstatvfs
201functions conform to
202.St -p1003.1-2001 .
203As standardized, portable applications cannot depend on these functions
204returning any valid information at all.
205This implementation attempts to provide as much useful information as
206is provided by the underlying file system, subject to the limitations
207of the specified data types.
208.Sh AUTHORS
209The
210.Fn statvfs
211and
212.Fn fstatvfs
213manual page was originally written by
214.An Garrett Wollman Aq wollman@FreeBSD.org .