STATFS System call Prototype:
int statfs(constcharstruct statfs *buf);
Parameter description:
path : 位于需要查询信息的文件系统的路径名(不是设备名,是挂载点名称)buf : statfs结构体的指针变量,用于储存文件系统相关的信息。
Statfs description of the structural body
Structure prototype:#If __wordsize = = +/* System Word size * /# define __sword_type int#Else /* __wordsize = = * *# define __sword_type long int#endif structStatfs {__sword_type f_type;/* File system type (see below) */__sword_type f_bsize;/ * Optimized transfer block size * /fsblkcnt_t f_blocks;/ * Total File system data blocks * /fsblkcnt_t F_bfree;/ * Number of available blocks * /fsblkcnt_t F_bavail;/ * Number of blocks that non-superuser can get * /fsfilcnt_t F_files;/ * Total number of File nodes * /fsfilcnt_t F_ffree;/ * Total number of available file nodes * /fsid_t F_fsid;/ * File System ID * /__sword_type F_namelen;/ * Maximum length of file name * /__sword_type f_frsize;/* Fragment size (since Linux 2.6) */__sword_type f_spare[5];}; The file types described by F_type are as follows: Adfs_super_magic0xadf5Affs_super_magic0xADFFBefs_super_magic0x42465331Bfs_magic0x1badfaceCifs_magic_number0xff534d42Coda_super_magic0x73757245Coh_super_magic0x012ff7b7Cramfs_magic0X28CD3D45Devfs_super_magic0x1373Efs_super_magic0x00414a53Ext_super_magic0x137dExt2_old_super_magic0xef51Ext2_super_magic0xef53Ext3_super_magic0xef53Ext4_super_magic0xef53Hfs_super_magic0x4244Hpfs_super_magic0xf995e849Hugetlbfs_magic0x958458f6Isofs_super_magic0x9660Jffs2_super_magic0x72b6Jfs_super_magic0x3153464aMinix_super_magic0x137f / * orig. Minix * /Minix_super_magic20x138f / * Char Minix * /Minix2_super_magic0x2468 / * Minix V2 * /Minix2_super_magic20x2478 / * Minix V2, char names * /Msdos_super_magic0x4d44Ncp_super_magic0x564cNfs_super_magic0x6969Ntfs_sb_magic0x5346544eOpenprom_super_magic0X9FA1Proc_super_magic0x9fa0Qnx4_super_magic0x002fReiserfs_super_magic0x52654973Romfs_magic0x7275Smb_super_magic0x517bSysv2_super_magic0x012ff7b6Sysv4_super_magic0x012ff7b5Tmpfs_magic0x01021994Udf_super_magic0x15013346Ufs_magic0x00011954Usbdevice_super_magic0X9FA2Vxfs_super_magic0xa501fcf5Xenix_super_magic0X012FF7B4Xfs_super_magic0x58465342_xiafs_super_magic0x012fd16d
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux C Statfs system call