statfs

Holds statistics about a file system.

Service:File and Directory

Structure

  #include <sys/statfs.h>
  
  struct statfs
  {
     int         f_fstyp;
     size_t      f_frsize;
     blksize_t   f_bsize;
     blkcnt_t    f_blocks;
     uint64_t    f_bfree;
     uint64_t    f_files;
     uint64_t    f_ffree; 
     uint64_t    f_fspare[2];
     char        f_fserver[_MAX_SERVER+4];
     char        f_fname [_MAX_VOLUME+4];
     char        f_fpack [20];
  };
  

Fields

f_fstyp

Specifies the volume type:

  • 0 indicates a traditional volume.
  • 1 indicates an NSS volume.
f_frsize

Specifies the fragment size.

f_bsize

Specifies the size of a block.

f_blocks

Specifies the total number of blocks.

f_bfree

Specifies the number of free blocks.

f_files

Specifies the total number of file nodes.

f_ffree

Specifies the number of free file nodes.

f_fspare

Reserved.

f_fserver

Specifies the server name.

f_fname

Specifies the volume name.

f_fpack

Currently not used.