struct statvfs, struct statvfs64

data structure containing detailed file system information 

Data Structure


SYNOPSIS

#include <sys/statvfs.h>

struct statvfs {
	unsigned long f_bsize;
	unsigned long f_frsize;
	fsblkcnt_t f_blocks;
	fsblkcnt_t f_bfree;
	fsblkcnt_t f_bavail;
	fsfilcnt_t f_files;
	fsfilcnt_t f_ffree;
	fsfilcnt_t f_favail;
	unsigned long f_fsid;
	unsigned long f_flag;
	unsigned long f_namemax;
	unsigned long f_type;
	char f_basetype[FSTYPSZ];
	char f_str[FSSTRSZ];
}; 

struct statvfs64 {
	unsigned long f_bsize;
	unsigned long f_frsize;
	fsblkcnt64_t f_blocks;
	fsblkcnt64_t f_bfree;
	fsblkcnt64_t f_bavail;
	fsfilcnt64_t f_files;
	fsfilcnt64_t f_ffree;
	fsfilcnt64_t f_favail;
	unsigned long f_fsid;
	unsigned long f_flag;
	unsigned long f_namemax;
	unsigned long f_type;
	char f_basetype[FSTYPSZ];
	char f_str[FSSTRSZ];
} statvfs64_t; 


DESCRIPTION

The statvfs structure is returned by the fstatvfs() and statvfs() functions. It provides detailed information about a file system. The information returned depends on the type of file system

The statvfs64 structure is identical to the statvfs structure except that it is designed to be used for larger disk volumes where the values to be returned cannot be correctly represented in the datatypes used in the statvfs structure. The statvfs64 structure is returned by the fstatvfs64() and statvfs64() functions, which are a part of the large file extensions.

Fields of the Structure

The statvfs and statvfs64 structure contains the following fields:

f_bsize  

File system block size.

f_frsize  

Fundamental file system block size (fragment size).

f_blocks  

Total number of blocks on the file system, in units of f_frsize.

f_bfree  

Total number of free blocks.

f_bavail  

Total number of free blocks available to non-privileged processes.

f_files  

Total number of file nodes (inodes) on the file system.

f_ffree  

Total number of free file nodes (inodes).

f_favail  

Total number of free file nodes (inodes) available to non-privileged processes.

f_fsid  

File system ID number.

f_flag  

Flags, described in the Flags section.

f_namemax  

Maximum length of a file name (path element).

f_type  

File system type, described in the File System Types section.

f_basetype  

File system type name.

f_fstr  

File-system-specified string; the first FSSTRSZ bytes of the volume name.

Flags

The st_flag field contains flags that describe properties of the file system:

Flag Meaning
ST_RDONLY File system is read-only
ST_NOSUID File system does not support setuid/setgid-bit semantics.
ST_QUOTA File system supports quotas.
ST_NOTRUNC File system does not truncate files longer than NAME_MAX.
ST_CASE_PRES File system preserves case of file names.
ST_CASE_SENS File system supports case-sensitive file names.
ST_UNICODE File system supports UNICODE path names.
ST_ACLS File system supports persistent ACLs for security.
ST_FILECOMP File system supports per-file compression.
ST_COMPRESSED File system is compressed.
ST_CRYPT File system supports encryption.
ST_OBJ_IDS File system supports object IDs.
ST_REPARSE File system supports reparse points.
ST_SPARSE File system supports sparse files

File System Types

The st_type field contains one of the following values:

Flag Meaning
ST_FST_NONE File system type could not be determined.
ST_FST_NFS Network File System (NFS).
ST_FST_FAT Traditional 8.3 DOS-style file system
ST_FST_HPFS OS/2 High-Performance File System.
ST_FST_NTFS New Technology File System.
ST_FST_CDFS ISO 9660 CD-ROM file system.
ST_FST_JOLIET Microsoft Joliet CD-ROM format.
ST_FST_VFAT New-style FAT file system with long-name support.
ST_FST_MVFS Rational ClearCase MultiView File System.


CONFORMANCE

UNIX 98, with exceptions.


PORTING ISSUES

Most of the flag values described in the DESCRIPTION section are derived from the Win32 GetVolumeInformation() API function. Refer to the Win32 on-line documentation for more information.

Windows does not support the concept of inodes. Therefore, the f_files, f_ffree, and f_favail fields are not useful, and always contain a large number, to ensure that code that indiscriminately compares against these fields does not fail. There is no reliable way to determine the number of files that can be created on a file system under Windows.

The base Windows 95 operating system, prior to the OEM Service Release 2 (OSR2) version, does not support file systems larger than 2G. Even though the operating system can access larger networked file systems, the function used to determine the size of a file system returns incorrect information. Hence fstatfvs() and statvfs() will return an incorrect size for network file systems larger than 2G. This problem does not occur on 8.1/2012R2/10/2016/2019/11/2022, on Windows 95 OSR2 or later, or on Windows 98/Millennium.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fstatvfs(), statvfs()

Miscellaneous:
lf64


PTC MKS Toolkit 10.4 Documentation Build 39.