|
|
#include <sys/types.h> #include <sys/statvfs.h>
unsigned long f_bsize; / fundamental file system block size / unsigned long f_frsize; / fragment size / unsigned long f_blocks; / total # of blocks of f__frsize on file system / fsblkcnt_t f_bfree; + / total # of free blocks of f_frsize / fsblkcnt_t f_bavail; + / total # of free blocks avail to non-superuser / fsfilcnt_t f_files; + / total # of file nodes (inodes) / fsfilcnt_t f_ffree; + / total # of free file nodes / fsfilcnt_t f_favail; + / # of free nodes avail to non-superuser/ unsigned long f_fsid; / file system id (dev for now) / char f_basetype[FSTYPSZ]; / target fs type name, null-terminated / unsigned long f_flag; / bit mask of flags / unsigned long f_namemax; / maximum file name length / char f_fstr[32]; / file system specific string / int st_aclcnt; / number of ACL entries (default is 4) / level_t st_level; / security level identifier (MAC) /
f_basetype contains a null-terminated FSType name of the mounted target (for example, s5 mounted over NFS will contain nfs).
The following flags can be returned in the ``f_flag'' field:
ST_RDONLY 0x01 / read-only file system / ST_NOSUID 0x02 / does not support setuid/setgid semantics / ST_NOTRUNC 0x04 / does not truncate file names longer / / than {NAME_MAX}/