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
35 .B #include <sys/statvfs.h>
37 .BI "int statvfs(const char *" path ", struct statvfs *" buf );
38 .BI "int fstatvfs(int " fd ", struct statvfs *" buf );
43 returns information about a mounted filesystem.
45 is the pathname of any file within the mounted filesystem.
49 structure defined approximately as follows:
54 unsigned long f_bsize; /* Filesystem block size */
55 unsigned long f_frsize; /* Fragment size */
56 fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */
57 fsblkcnt_t f_bfree; /* Number of free blocks */
58 fsblkcnt_t f_bavail; /* Number of free blocks for
60 fsfilcnt_t f_files; /* Number of inodes */
61 fsfilcnt_t f_ffree; /* Number of free inodes */
62 fsfilcnt_t f_favail; /* Number of free inodes for
64 unsigned long f_fsid; /* Filesystem ID */
65 unsigned long f_flag; /* Mount flags */
66 unsigned long f_namemax; /* Maximum filename length */
82 is a bit mask indicating various options that were employed
83 when mounting this filesystem.
84 It contains zero or more of the following flags:
85 .\" XXX Keep this list in sync with statfs(2)
88 Mandatory locking is permitted on the filesystem (see
92 Do not update access times; see
96 Disallow access to device special files on this filesystem.
99 Do not update directory access times; see
103 Execution of programs is disallowed on this filesystem.
106 The set-user-ID and set-group-ID bits are ignored by
108 for executable files on this filesystem
111 This filesystem is mounted read-only.
114 Update atime relative to mtime/ctime; see
118 Writes are synched to the filesystem immediately (see the description of
123 It is unspecified whether all members of the returned struct
124 have meaningful values on all filesystems.
127 returns the same information about an open file referenced by descriptor
130 On success, zero is returned.
131 On error, \-1 is returned, and
133 is set to indicate the error.
138 Search permission is denied for a component of the path prefix of
141 .BR path_resolution (7).)
146 is not a valid open file descriptor.
152 points to an invalid address.
155 This call was interrupted by a signal; see
159 An I/O error occurred while reading from the filesystem.
163 Too many symbolic links were encountered in translating
173 The file referred to by
178 Insufficient kernel memory was available.
181 The filesystem does not support this call.
185 A component of the path prefix of
190 Some values were too large to be represented in the returned struct.
192 For an explanation of the terms used in this section, see
200 Interface Attribute Value
204 T} Thread safety MT-Safe
210 POSIX.1-2001, POSIX.1-2008.
218 field are specified in POSIX.1.
219 To obtain definitions of the remaining flags, one must define
222 The Linux kernel has system calls
226 to support this library call.
228 In glibc versions before 2.13,
229 .\" glibc commit 3cdaa6adb113a088fdfb87aa6d7747557eccc58d
231 populated the bits of the
233 field by scanning the mount options shown in
235 However, starting with Linux 2.6.36, the underlying
237 system call provides the necessary information via the
239 field, and since glibc version 2.13, the
241 function will use information from that field rather than scanning
244 The glibc implementations of
248 pathconf(path, _PC_REC_XFER_ALIGN);
249 pathconf(path, _PC_ALLOC_SIZE_MIN);
250 pathconf(path, _PC_REC_MIN_XFER_SIZE);
259 fields returned by a call to