Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fstatvfs, statvfs - file system information

&pagelevel(4)&pagelevel

The program interfaces fstatvfs and statvfs supply information about the file system which contains a file. This file is specified by a file descriptor in the case of fstatvfs and by its name in the case of statvfs.

In both cases the information is output in the format which is defined in the sys/statvfs.h header in the statvfs_t structure.


typedef struct statvfs {
  unsigned long f_bsize;         /* Block size of the file system */
  unsigned long f_frsize;        /* Fragment size */
  unsigned long f_blocks;        /* # Blocks on file system with size f_frsize */
  unsigned long f_bfree;         /* # Free blocks with size f_frsize */
  unsigned long f_bavail;        /* # Available free blocks for non-superusers */
  unsigned long f_files;         /* # File nodes (inodes) */
  unsigned long f_ffree;         /* # Free file nodes (inodes) */
  unsigned long f_favail;        /* # Available free inodes for non-superusers */
  unsigned long f_fsid;          /* File system ID (number) */
  char f_basetype[FSTYPSZ];      /* Name of the target file system, Null-terminated */
  unsigned long f_flag;          /* Bit mask for the options of f_flag */
  unsigned long f_namemax;       /* Maximum length of the file names */
  char f_fstr[32);               /* File-system-specific string */
  unsigned long f_filler[16];    /* Reserved for future versions */
} statvfs_t;


This format is, however, tailored to ufs file systems. For a bs2fs file system the user must interpret this information as shown in the table below. The data is generated using the BS2000 interface $SJINFO.


unsigned long f_bsize

Set to 2048 (PAMBLOCKSIZE).

unsigned long f_frsize

Set to 2048 (PAMBLOCKSIZE).

unsigned long f_blocks (*)

This data is obtained from the corresponding values of the BS2000 interface $SJINFO. However, not all BS2000 values can be mapped to an exact equivalent which is used for ufs file systems.

unsigned long f_bfree (*)

unsigned long f_bavail (*)

unsigned long f_files (*)

unsigned long f_ffree (*)

unsigned long f_favail (*)

unsigned long f_fsid

Contains the index which is used by the sysfs interface.

char f_basetype[FSTYPSZ]

Contains the string "bs2fs" for identification.

unsigned long f_flag

Only the ST_RDONLY flag is relevant.

unsigned long f_namemax

Is set to 38 - 41 in accordance with the catalog and user IDs. This value applies for DMS files and PLAM libraries only. In the case of library elements or types, the variable is assigned the value for the higher-ranking PLAM library. The restrictions for names of elements and element types can only be ascertained with pathconf. Within the restriction of "Elementname+Version" to 89 characters it must be borne in mind that the Elementname component is limited to 64 characters and the Version component to 24 characters.

char f_fstr[32]


(*)unsigned long long in the case of fstatvfs64() or statvfs64()