2002-07-13 19:29:44 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright 2002 Massachusetts Institute of Technology
|
|
|
|
.\"
|
|
|
|
.\" Permission to use, copy, modify, and distribute this software and
|
|
|
|
.\" its documentation for any purpose and without fee is hereby
|
|
|
|
.\" granted, provided that both the above copyright notice and this
|
|
|
|
.\" permission notice appear in all copies, that both the above
|
|
|
|
.\" copyright notice and this permission notice appear in all
|
|
|
|
.\" supporting documentation, and that the name of M.I.T. not be used
|
|
|
|
.\" in advertising or publicity pertaining to distribution of the
|
|
|
|
.\" software without specific, written prior permission. M.I.T. makes
|
|
|
|
.\" no representations about the suitability of this software for any
|
|
|
|
.\" purpose. It is provided "as is" without express or implied
|
|
|
|
.\" warranty.
|
2002-12-04 15:47:41 +00:00
|
|
|
.\"
|
2002-07-13 19:29:44 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
|
|
|
.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
|
|
|
|
.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
|
|
|
.Dd July 13, 2002
|
|
|
|
.Dt STATVFS 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm statvfs ,
|
|
|
|
.Nm fstatvfs
|
2002-12-12 17:26:04 +00:00
|
|
|
.Nd retrieve file system information
|
2002-07-13 19:29:44 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/statvfs.h
|
|
|
|
.Ft int
|
2002-09-06 11:24:06 +00:00
|
|
|
.Fn statvfs "const char * restrict path" "struct statvfs * restrict buf"
|
2002-07-13 19:29:44 +00:00
|
|
|
.Ft int
|
2002-07-16 20:40:12 +00:00
|
|
|
.Fn fstatvfs "int fd" "struct statvfs *buf"
|
2002-07-13 19:29:44 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn statvfs
|
|
|
|
and
|
|
|
|
.Fn fstatvfs
|
|
|
|
functions fill the structure pointed to by
|
|
|
|
.Fa buf
|
|
|
|
with garbage.
|
2002-12-12 17:26:04 +00:00
|
|
|
This garbage will occasionally bear resemblance to file system
|
2002-07-13 19:29:44 +00:00
|
|
|
statistics, but portable applications must not depend on this.
|
|
|
|
Applications must pass a pathname or file descriptor which refers to a
|
2002-12-12 17:26:04 +00:00
|
|
|
file on the file system in which they are interested.
|
2002-07-13 19:29:44 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2002-07-16 20:40:12 +00:00
|
|
|
.Vt statvfs
|
2002-07-13 19:29:44 +00:00
|
|
|
structure contains the following members:
|
2002-12-04 15:47:41 +00:00
|
|
|
.Bl -tag -offset indent -width ".Va f_namemax"
|
2002-07-13 19:29:44 +00:00
|
|
|
.It Va f_namemax
|
2002-12-12 17:26:04 +00:00
|
|
|
The maximum length in bytes of a file name on this file system.
|
2002-07-13 19:29:44 +00:00
|
|
|
Applications should use
|
2003-06-08 10:01:52 +00:00
|
|
|
.Xr pathconf 2
|
2002-07-13 19:29:44 +00:00
|
|
|
instead.
|
|
|
|
.It Va f_fsid
|
|
|
|
Not meaningful in this implementation.
|
|
|
|
.It Va f_frsize
|
|
|
|
The size in bytes of the minimum unit of allocation on this
|
2002-12-12 17:26:04 +00:00
|
|
|
file system.
|
2002-07-13 19:29:44 +00:00
|
|
|
(This corresponds to the
|
|
|
|
.Va f_bsize
|
|
|
|
member of
|
|
|
|
.Vt "struct statfs" . )
|
|
|
|
.It Va f_bsize
|
2002-12-12 17:26:04 +00:00
|
|
|
The preferred length of I/O requests for files on this file system.
|
2002-07-13 19:29:44 +00:00
|
|
|
(Corresponds to the
|
|
|
|
.Va f_iosize
|
|
|
|
member of
|
|
|
|
.Vt "struct statfs" . )
|
|
|
|
.It Va f_flag
|
2002-12-12 17:26:04 +00:00
|
|
|
Flags describing mount options for this file system; see below.
|
2002-07-13 19:29:44 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
In addition, there are three members of type
|
|
|
|
.Vt fsfilcnt_t ,
|
|
|
|
which represent counts of file serial numbers
|
2002-12-04 15:47:41 +00:00
|
|
|
.Em ( i.e. ,
|
|
|
|
inodes); these are named
|
|
|
|
.Va f_files , f_favail ,
|
2002-07-13 19:29:44 +00:00
|
|
|
and
|
|
|
|
.Va f_ffree ,
|
|
|
|
and represent the number of file serial numbers which exist in total,
|
|
|
|
are available to unprivileged processes, and are available to
|
|
|
|
privileged processes, respectively.
|
|
|
|
Likewise, the members
|
2002-12-04 15:47:41 +00:00
|
|
|
.Va f_blocks , f_bavail ,
|
2002-07-13 19:29:44 +00:00
|
|
|
and
|
|
|
|
.Va f_bfree
|
|
|
|
(all of type
|
|
|
|
.Vt fsblkcnt_t )
|
|
|
|
represent the respective allocation-block counts.
|
|
|
|
.Pp
|
|
|
|
There are two flags defined for the
|
|
|
|
.Va f_flag
|
|
|
|
member:
|
2002-12-04 15:47:41 +00:00
|
|
|
.Bl -tag -offset indent -width ".Dv ST_NOSUID"
|
2002-07-13 19:29:44 +00:00
|
|
|
.It Dv ST_RDONLY
|
2002-12-12 17:26:04 +00:00
|
|
|
The file system is mounted read-only.
|
2002-07-13 19:29:44 +00:00
|
|
|
.It Dv ST_NOSUID
|
|
|
|
The semantics of the
|
|
|
|
.Dv S_ISUID
|
|
|
|
and
|
|
|
|
.Dv S_ISGID
|
|
|
|
file mode bits
|
2002-12-12 17:26:04 +00:00
|
|
|
are not supported by, or are disabled on, this file system.
|
2002-07-13 19:29:44 +00:00
|
|
|
.El
|
|
|
|
.Sh IMPLEMENTATION NOTES
|
|
|
|
The
|
|
|
|
.Fn statvfs
|
|
|
|
and
|
|
|
|
.Fn fstatvfs
|
|
|
|
functions are implemented as wrappers around the
|
|
|
|
.Fn statfs
|
|
|
|
and
|
|
|
|
.Fn fstatfs
|
|
|
|
functions, respectively.
|
|
|
|
Not all the information provided by those functions is made available
|
|
|
|
through this interface.
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
.Rv -std statvfs fstatvfs
|
|
|
|
.Sh ERRORS
|
|
|
|
The
|
|
|
|
.Fn statvfs
|
|
|
|
and
|
2002-07-13 19:38:59 +00:00
|
|
|
.Fn fstatvfs
|
2002-07-13 19:29:44 +00:00
|
|
|
functions may fail for any of the reasons documented for
|
|
|
|
.Xr statfs 2
|
2002-07-13 19:38:59 +00:00
|
|
|
or
|
2002-12-04 15:47:41 +00:00
|
|
|
.Xr fstatfs 2
|
2002-07-13 19:38:59 +00:00
|
|
|
and
|
2003-06-08 10:01:52 +00:00
|
|
|
.Xr pathconf 2
|
2002-07-13 19:38:59 +00:00
|
|
|
or
|
2003-06-08 10:01:52 +00:00
|
|
|
.Xr fpathconf 2 ,
|
2002-07-13 19:38:59 +00:00
|
|
|
respectively.
|
|
|
|
In addition,
|
|
|
|
.Fn statvfs
|
2002-07-13 19:29:44 +00:00
|
|
|
and
|
2002-07-13 19:38:59 +00:00
|
|
|
.Fn fstatvfs
|
|
|
|
functions may also fail for the following reason:
|
2002-07-13 19:29:44 +00:00
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EOVERFLOW
|
2002-12-12 17:26:04 +00:00
|
|
|
One or more of the file system statistics has a value which cannot be
|
2002-07-13 19:29:44 +00:00
|
|
|
represented by the data types used in
|
|
|
|
.Vt "struct statvfs" .
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
2003-06-08 10:01:52 +00:00
|
|
|
.Xr pathconf 2 ,
|
|
|
|
.Xr statfs 2
|
2002-07-13 19:29:44 +00:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Fn statvfs
|
|
|
|
and
|
|
|
|
.Fn fstatvfs
|
|
|
|
functions conform to
|
|
|
|
.St -p1003.1-2001 .
|
|
|
|
As standardized, portable applications cannot depend on these functions
|
|
|
|
returning any valid information at all.
|
|
|
|
This implementation attempts to provide as much useful information as
|
2002-12-12 17:26:04 +00:00
|
|
|
is provided by the underlying file system, subject to the limitations
|
2002-07-13 19:29:44 +00:00
|
|
|
of the specified data types.
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2002-12-04 15:47:41 +00:00
|
|
|
.Fn statvfs
|
|
|
|
and
|
|
|
|
.Fn fstatvfs
|
|
|
|
functions first appeared in
|
2002-07-13 19:29:44 +00:00
|
|
|
.Fx 5.0 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
2002-12-04 15:47:41 +00:00
|
|
|
.Fn statvfs
|
|
|
|
and
|
|
|
|
.Fn fstatvfs
|
|
|
|
functions and this manual page were written by
|
2014-06-23 08:25:03 +00:00
|
|
|
.An Garrett Wollman Aq Mt wollman@FreeBSD.org .
|