1 .\" Copyright (C) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" The pathconf note is from Walter Harms
26 .\" This is not a system call on Linux
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
30 .TH STATVFS 3 2017-09-15 "Linux" "Linux Programmer's Manual"
32 statvfs, fstatvfs \- get filesystem statistics
34 .B #include <sys/statvfs.h>
36 .BI "int statvfs(const char *" path ", struct statvfs *" buf );
38 .BI "int fstatvfs(int " fd ", struct statvfs *" buf );
42 returns information about a mounted filesystem.
44 is the pathname of any file within the mounted filesystem.
48 structure defined approximately as follows:
53 unsigned long f_bsize; /* Filesystem block size */
54 unsigned long f_frsize; /* Fragment size */
55 fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */
56 fsblkcnt_t f_bfree; /* Number of free blocks */
57 fsblkcnt_t f_bavail; /* Number of free blocks for
59 fsfilcnt_t f_files; /* Number of inodes */
60 fsfilcnt_t f_ffree; /* Number of free inodes */
61 fsfilcnt_t f_favail; /* Number of free inodes for
63 unsigned long f_fsid; /* Filesystem ID */
64 unsigned long f_flag; /* Mount flags */
65 unsigned long f_namemax; /* Maximum filename length */
81 is a bit mask indicating various options that were employed
82 when mounting this filesystem.
83 It contains zero or more of the following flags:
84 .\" XXX Keep this list in sync with statfs(2)
87 Mandatory locking is permitted on the filesystem (see
91 Do not update access times; see
95 Disallow access to device special files on this filesystem.
98 Do not update directory access times; see
102 Execution of programs is disallowed on this filesystem.
105 The set-user-ID and set-group-ID bits are ignored by
107 for executable files on this filesystem
110 This filesystem is mounted read-only.
113 Update atime relative to mtime/ctime; see
117 Writes are synched to the filesystem immediately (see the description of
122 It is unspecified whether all members of the returned struct
123 have meaningful values on all filesystems.
126 returns the same information about an open file referenced by descriptor
129 On success, zero is returned.
130 On error, \-1 is returned, and
132 is set appropriately.
137 Search permission is denied for a component of the path prefix of
140 .BR path_resolution (7).)
145 is not a valid open file descriptor.
151 points to an invalid address.
154 This call was interrupted by a signal; see
158 An I/O error occurred while reading from the filesystem.
162 Too many symbolic links were encountered in translating
172 The file referred to by
177 Insufficient kernel memory was available.
180 The filesystem does not support this call.
184 A component of the path prefix of
189 Some values were too large to be represented in the returned struct.
191 For an explanation of the terms used in this section, see
197 Interface Attribute Value
201 T} Thread safety MT-Safe
204 POSIX.1-2001, POSIX.1-2008.
212 field are specified in POSIX.1.
213 To obtain definitions of the remaining flags, one must define
216 The Linux kernel has system calls
220 to support this library call.
222 In glibc versions before 2.13,
223 .\" glibc commit 3cdaa6adb113a088fdfb87aa6d7747557eccc58d
225 populated the bits of the
227 field by scanning the mount options shown in
229 However, starting with Linux 2.6.36, the underlying
231 system call provides the necessary information via the
233 field, and since glibc version 2.13, the
235 function will use information from that field rather than scanning
238 The glibc implementations of
242 pathconf(path, _PC_REC_XFER_ALIGN);
243 pathconf(path, _PC_ALLOC_SIZE_MIN);
244 pathconf(path, _PC_REC_MIN_XFER_SIZE);
253 fields returned by a call to