[BACK]Return to statvfs.5 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man5

File: [cvs.NetBSD.org] / src / share / man / man5 / statvfs.5 (download)

Revision 1.13, Fri Apr 5 17:33:06 2013 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.12: +3 -2 lines

clarify the units of fsblkcnt_t

.\"	$NetBSD: statvfs.5,v 1.13 2013/04/05 17:33:06 christos Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
.\"
.\"	@(#)statfs.2	8.5 (Berkeley) 5/24/95
.\"
.Dd April 5, 2013
.Dt STATVFS 5
.Os
.Sh NAME
.Nm statvfs
.Nd file system statistics
.Sh SYNOPSIS
.In sys/types.h
.In sys/statvfs.h
.Sh DESCRIPTION
The
.In sys/statvfs.h
header defines the structures and functions that
return information about a mounted file system.
The
.Nm statvfs
structure is defined as follows:
.Bd -literal
typedef struct { int32_t val[2]; } fsid_t;	/* file system id type */

#define VFS_NAMELEN  32 	/* length of fs type name, including nul */
#define VFS_MNAMELEN 1024	/* length of buffer for returned name */

struct statvfs {
	unsigned long	f_flag;	  /* copy of mount exported flags */
	unsigned long	f_bsize;  /* system block size */
	unsigned long	f_frsize; /* system fragment size */
	unsigned long	f_iosize; /* optimal file system block size */

	/* The following are in units of f_frsize */
	fsblkcnt_t	f_blocks; /* number of blocks in file system */
	fsblkcnt_t	f_bfree;  /* free blocks avail in file system */
	fsblkcnt_t	f_bavail; /* free blocks avail to non-root */
	fsblkcnt_t	f_bresvd; /* blocks reserved for root */

	fsfilcnt_t	f_files;  /* total file nodes in file system */
	fsfilcnt_t	f_ffree;  /* free file nodes in file system */
	fsfilcnt_t	f_favail; /* free file nodes avail to non-root */
	fsfilcnt_t	f_fresvd; /* file nodes reserved for root */

	uint64_t  f_syncreads;	  /* count of sync reads since mount */
	uint64_t  f_syncwrites;	  /* count of sync writes since mount */

	uint64_t  f_asyncreads;	  /* count of async reads since mount */
	uint64_t  f_asyncwrites;  /* count of async writes since mount */

	unsigned long	f_fsid;   /* POSIX compliant file system id */
	fsid_t          f_fsidx;  /* NetBSD compatible file system id */

	unsigned long	f_namemax;/* maximum filename length */
	uid_t		f_owner; /* user that mounted the file system */

	uint32_t	f_spare[4]; /* spare space */

	char	f_fstypename[VFS_NAMELEN]; /* fs type name */
	char	f_mntonname[VFS_MNAMELEN]; /* directory on which mounted */
	char	f_mntfromname[VFS_MNAMELEN]; /* mounted file system */
};
.Ed
.Pp
The
.Fa f_flag
argument can have the following bits set:
.Bl -tag -width ST_SYNCHRONOUS
.It Dv ST_RDONLY
The filesystem is mounted read-only;
Even the super-user may not write on it.
.It Dv ST_NOEXEC
Files may not be executed from the filesystem.
.It Dv ST_NOSUID
Setuid and setgid bits on files are not honored when they are executed.
.It Dv ST_NODEV
Special files in the filesystem may not be opened.
.It Dv ST_UNION
Union with underlying filesystem instead of obscuring it.
.It Dv ST_SYNCHRONOUS
All I/O to the filesystem is done synchronously.
.It Dv ST_ASYNC
No filesystem I/O is done synchronously.
.It Dv ST_NOCOREDUMP
Don't write core dumps to this file system.
.It Dv ST_NOATIME
Never update access times.
.It Dv ST_SYMPERM
Recognize symbolic link permission.
.It Dv ST_NODEVMTIME
Never update modification times for device files.
.It Dv ST_LOG
Use logging (journalling).
.It Dv ST_LOCAL
The filesystem resides locally.
.It Dv ST_QUOTA
The filesystem has quotas enabled on it.
.It Dv ST_ROOTFS
Identifies the root filesystem.
.It Dv ST_EXRDONLY
The filesystem is exported read-only.
.It Dv ST_EXPORTED
The filesystem is exported for both reading and writing.
.It Dv ST_DEFEXPORTED
The filesystem is exported for both reading and writing to any Internet host.
.It Dv ST_EXPORTANON
The filesystem maps all remote accesses to the anonymous user.
.It Dv ST_EXKERB
The filesystem is exported with Kerberos uid mapping.
.It Dv ST_EXNORESPORT
Don't enforce reserved ports (NFS).
.It Dv ST_EXPUBLIC
Public export (WebNFS).
.El
.Pp
Fields that are undefined for a particular file system are set to \-1.
.Sh NOTES
.Bl -tag -width f_bavail
.It f_flag
The
.Fa f_flag
field is the same as the
.Fa f_flags
field in the
.Bx 4.3
.Xr statfs 2
system call.
.It f_fsid
Is defined to be
.Ft unsigned long
by the X/Open standard.
Unfortunately this is not enough space to store our
.Ft fsid_t ,
so we define an additional
.Fa f_fsidx
field.
.It f_bavail
Could historically be negative (in the
.Xr statfs 2
system call) when the used space has exceeded
the non-superuser free space.
In order to comply with the X/Open standard, we have to define
.Ft fsblkcnt_t
as an unsigned type, so in all cases where
.Fa f_bavail
would have been negative, we set it to 0.
In addition we provide
.Fa f_bresvd
which contains the amount of reserved blocks for the superuser, so
the old value of
.Fa f_bavail
can be easily computed as:
.Bd -literal
	old_bavail = f_bfree - f_bresvd;
.Ed
.El
.Sh SEE ALSO
.Xr statvfs 2
.Sh HISTORY
The
.In sys/statvfs.h
header first appeared in
.Nx 3.0 .