struct statvfs vfs;
    statvfs("/", &vfs);
    printf("File system block size: %lun",vfs.f_bsize);
    printf("Fundamental file system block size: %lun",vfs.f_frsize);
    printf("Blocks on FS in units of f_frsize: %dn",vfs.f_blocks);
    printf("Free blocks: %dn",vfs.f_bfree);
    printf("Blocks available to non-root: %dn",vfs.f_bavail);
    printf("Total inodes: %dn",vfs.f_files);
    printf("Free inodes: %dn",vfs.f_ffree);
    printf("Free inodes for non-root: %dn",vfs.f_favail);
    printf("Filesystem ID: %lun",vfs.f_fsid);
    printf("Bit mask of values: %lun",vfs.f_flag);
    printf("Max file name length: %lun",vfs.f_namemax);
声明: 本文为0xBBC原创, 转载注明出处喵~


电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.