1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" The pathconf note is from Walter Harms
24 .\" This is not a system call on Linux
26 .\" Modified 2004-06-23 by Michael Kerrisk <mtk-manpages@gmx.net>
28 .TH STATVFS 2 2003-08-22 "Linux" "Linux Programmer's Manual"
30 statvfs, fstatvfs \- get file system statistics
32 .B #include <sys/statvfs.h>
34 .BI "int statvfs(const char *" path ", struct statvfs *" buf );
36 .BI "int fstatvfs(int " fd ", struct statvfs *" buf );
40 returns information about a mounted file system.
42 is the pathname of any file within the mounted filesystem.
46 structure defined approximately as follows:
50 unsigned long f_bsize; /* file system block size */
51 unsigned long f_frsize; /* fragment size */
52 fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
53 fsblkcnt_t f_bfree; /* # free blocks */
54 fsblkcnt_t f_bavail; /* # free blocks for non-root */
55 fsfilcnt_t f_files; /* # inodes */
56 fsfilcnt_t f_ffree; /* # free inodes */
57 fsfilcnt_t f_favail; /* # free inodes for non-root */
58 unsigned long f_fsid; /* file system ID */
59 unsigned long f_flag; /* mount flags */
60 unsigned long f_namemax; /* maximum filename length */
75 is a bit mask (of mount flags, see
77 Bits defined by POSIX are
80 Read-only file system.
83 Set-user-ID/set-group-ID bits are ignored by
86 It is unspecified whether all members of the returned struct
87 have meaningful values on all filesystems.
90 returns the same information about an open file referenced by descriptor
93 On success, zero is returned.
94 On error, \-1 is returned, and
101 Search permission is denied for a component of the path prefix of
104 .BR path_resolution (7).)
109 is not a valid open file descriptor.
115 points to an invalid address.
118 This call was interrupted by a signal.
121 An I/O error occurred while reading from the file system.
125 Too many symbolic links were encountered in translating
135 The file referred to by
140 Insufficient kernel memory was available.
143 The file system does not support this call.
147 A component of the path prefix of
152 Some values were too large to be represented in the returned struct.
156 The Linux kernel has system calls
160 to support this library call.
162 The current glibc implementations of
165 pathconf(path, _PC_REC_XFER_ALIGN);
166 pathconf(path, _PC_ALLOC_SIZE_MIN);
167 pathconf(path, _PC_REC_MIN_XFER_SIZE);
175 fields of the return value of
176 .IR "statvfs(path,buf)" .