1 .\" $OpenBSD: statvfs.3,v 1.5 2008/03/26 09:37:59 jmc Exp $
2 .\" $NetBSD: statfs.2,v 1.10 1995/06/29 11:40:48 cgd Exp $
3 .\" $DragonFly: src/lib/libc/sys/statvfs.2,v 1.3 2008/09/30 08:28:36 swildner Exp $
5 .\" Copyright (c) 1989, 1991, 1993
6 .\" The Regents of the University of California. All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)statfs.2 8.3 (Berkeley) 2/11/94
34 .Dd September 28, 2008
40 .Nd get file system statistics
46 .Fn statvfs "const char *path" "struct statvfs *buf"
48 .Fn fstatvfs "int fd" "struct statvfs *buf"
51 returns information about a mounted file system.
53 is the path name of any file within the mounted file system.
57 structure defined as follows:
60 unsigned long f_bsize; /* file system block size */
61 unsigned long f_frsize; /* fundamental file system block size */
62 fsblkcnt_t f_blocks; /* number of blocks (unit f_frsize) */
63 fsblkcnt_t f_bfree; /* free blocks in file system */
64 fsblkcnt_t f_bavail; /* free blocks for non-root */
65 fsfilcnt_t f_files; /* total file inodes */
66 fsfilcnt_t f_ffree; /* free file inodes */
67 fsfilcnt_t f_favail; /* free file inodes for to non-root */
68 unsigned long f_fsid; /* file system id */
69 unsigned long f_flag; /* bit mask of f_flag values */
70 unsigned long f_namemax; /* maximum filename length */
71 uid_t f_owner; /* user that mounted the filesystem */
72 unsigned int f_type; /* filesystem type */
74 uint64_t f_syncreads; /* count of sync reads since mount */
75 uint64_t f_syncwrites; /* count of sync writes since mount */
77 uint64_t f_asyncreads; /* count of async reads since mount */
78 uint64_t f_asyncwrites; /* count of async writes since mount */
81 * DragonFly extensions - full uuid FSID and owner
90 #define ST_RDONLY 0x00000001 /* fs is read-only */
91 #define ST_NOSUID 0x00000002 /* ST_ISUID or ST_ISGID not supported */
94 * DragonFly specific flags
96 #define ST_FSID_UUID 0x40000000 /* f_fsid_uuid field is valid */
97 #define ST_OWNER_UUID 0x80000000 /* f_owner_uuid field is valid */
102 are reported in units of
106 returns the same information about an open file referenced by descriptor
109 .Rv -std statvfs fstatvfs
112 fails if one or more of the following are true:
115 A component of the path prefix of
118 .It Bq Er ENAMETOOLONG
119 The length of a component of
123 characters, or the length of
129 The file referred to by
133 Search permission is denied for a component of the path prefix of
136 Too many symbolic links were encountered in translating
142 points to an invalid address.
146 error occurred while reading from or writing to the file system.
150 fails if one or more of the following are true:
154 is not a valid open file descriptor.
157 points to an invalid address.
161 error occurred while reading from or writing to the file system.
173 system calls conform to
180 functions first appeared in