zoukankan      html  css  js  c++  java
  • 获取主机硬件资源 函数


    1、

    NAME
           statfs, fstatfs - get file system statistics


    SYNOPSIS
           #include <sys/vfs.h>    /* or <sys/statfs.h> */


           int statfs(const char *path, struct statfs *buf);
           int fstatfs(int fd, struct statfs *buf);


    DESCRIPTION
           The  function statfs() returns information about a mounted file system.
           path is the pathname of any file within the mounted filesystem.  buf is
           a pointer to a statfs structure defined approximately as follows:


                  struct statfs {
                     long    f_type;     /* type of filesystem (see below) */
                     long    f_bsize;    /* optimal transfer block size */
                     long    f_blocks;   /* total data blocks in file system */  ////  总量
                     long    f_bfree;    /* free blocks in fs */                              ///  余量

                     long    f_bavail;   /* free blocks avail to non-superuser */
                     long    f_files;    /* total file nodes in file system */
                     long    f_ffree;    /* free file nodes in fs */
                     fsid_t  f_fsid;     /* file system id */
                     long    f_namelen;  /* maximum length of filenames */
                  };


                  File system types:


                     ADFS_SUPER_MAGIC      0xadf5
                     AFFS_SUPER_MAGIC      0xADFF
                     BEFS_SUPER_MAGIC      0x42465331
                     BFS_MAGIC             0x1BADFACE
                     CIFS_MAGIC_NUMBER     0xFF534D42
                     CODA_SUPER_MAGIC      0x73757245
                     COH_SUPER_MAGIC       0x012FF7B7
                     CRAMFS_MAGIC          0x28cd3d45



  • 相关阅读:
    bat学习
    Eclipse调试方法及快捷键
    JDK中的设计模式
    开源-自由-乔布斯
    AOP
    编程语言
    [LeetCode] 160. Intersection of Two Linked Lists(两个单链表的交集)
    [LeetCode] 198. House Robber(小偷)
    [LeetCode] 155. Min Stack(最小栈)
    [LeetCode] 1. Two Sum(两数之和)
  • 原文地址:https://www.cnblogs.com/roger0212/p/4436635.html
Copyright © 2011-2022 走看看