statvfs, fstatvfs - Get file system information
const char *path,
struct statvfs *buffer ); int fstatvfs
struct statvfs *buffer );
Interfaces documented on this reference page conform to industry stan‐
dards as follows:
fstatvfs(), statvfs(): POSIX.1, XSH4.2, XSH5.0
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
Specifies any file within the mounted file system. Specifies a file
descriptor obtained by a successful open() or fcntl() function. Points
to a statvfs buffer to hold the returned information for the statvfs()
or fstatvfs() function. See DESCRIPTION for the contents of the statvfs
The statvfs() and fstatvfs() functions return descriptive information
about a mounted file system. The returned information is in the format
of a statvfs structure, which is defined in the <sys/statvfs.h> header
file and contains the following members: The file system block size.
The fundamental file system block size. The total number of blocks in
the file system in units of f_frsize. The total number of free blocks.
The number of free blocks available to a non-privileged process. (Not
applicable to AdvFS.) The total number of file serial numbers (for
example, inodes). The total number of free file serial numbers. (For
UFS and AdvFS, f_ffree and f_favail are synonymous.) The number of
file serial numbers available to a non-privileged process. (For UFS and
AdvFS, f_ffree and f_favail are synonymous.) The file system identi‐
fier. A bit mask representing one or more of the followng flags: The
file system is read only. The file system does not support setuid/set‐
gid semantics. The maximum length of a file name.
Upon successful completion, either function returns 0 (zero). Other‐
wise, it returns -1 and sets errno to indicate the error.
If the statvfs() function fails, errno may be set to one of the follow‐
ing values: Search permission is denied for a component of the path
prefix. [Tru64 UNIX] The requested address is invalid. An I/O error
occurred while reading the file system. A signal was caught during
execution of the function. [Tru64 UNIX] One of the values returned to
the statvfs structure is invalid. This can happen when the file system
is mounted through NFS and the NFS server returns an error to an NFS
client call that was indirectly invoked through statvfs(). Too many
symbolic links were encountered in translating the path parameter
detected. The length of a component of the path parameter exceeds
NAME_MAX, or the length of the path parameter exceeds PATH_MAX.
Pathname resolution of a symbolic link produced an intermediate
result whose length exceeds PATH_MAX. A component of path does
not name an existing file or path is an empty string. A compo‐
nent of the path prefix of the path parameter is not a direc‐
If the fstatvfs() function fails, errno may be set to the following
values: The file descriptor parameter contains an invalid value.
[Tru64 UNIX] The requested address is invalid. A signal was caught
during execution of the function. [Tru64 UNIX] One of the values
returned to the fstatvfs structure is invalid. This can happen when the
file system is mounted through NFS and the NFS server returns an error
to an NFS client call that was indirectly invoked through statvfs().
For AdvFS, the target file system belongs to an AdvFS domain that,
after the file descriptor was opened, became inaccessible because of a
Functions: stat(2), statfs(2)