statfs 主要用来获得磁盘的空间
sun 系统下为 statvfs, linux系统下为statfs
#ifdef sun
#include <sys/statvfs.h>
#endif
#ifdef linux
#include <sys/vfs.h>
// 此处也可以为<sys/statfs.h>
#endif
<sys/statfs.h>
中调用<bits/statfs.h>
<bits/statfs.h>
下有结构
struct
statfs
{
_SWORD_TYPE
f_type;
_SWORD_TYPE
f_bsize;
// file system
block
size
#ifndef
__USE_FILE_OFFSET64
__fsblkcnt_t
f_blocks;
//size of fs in f_frsize units
__fsblkcnt_t
f_bfree;
// free blocks
__fsblkcnt_t
f_bavail;
// free blocks for non-root
__fsfilcnt_t
f_files;
// inods
__fsfilcnt_t
f_ffree;
// free inods
#else
__fsblkcnt64_t
f_blocks;
__fsblkcnt64_t
f_bfree;
__fsblkcnt64_t
f_bavail;
//可用的块数
__fsfilcnt64_t
f_files;
__fsfilcnt64_t
f_ffree;
#endif
__fsid_t
f_fsid;
// file system ID