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