[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Files Reference


statfs.h File

Purpose

Describes the structure of the statistics returned by the statfs, fstatfs, or ustat subroutine.

Description

The statfs and fstatfs subroutines return information on a mounted (virtual) file system in the form of a statfs structure. The /usr/include/sys/statfs.h file describes the statfs structure, which contains the following fields:

f_version Version number of the statfs structure. This value is currently 0.
f_length Length of the buffer that contains the returned information. This value is currently 0.
f_type Type of information returned. This value is currently 0.
f_bsize Optimal block size of the file system.
f_blocks Total number of blocks in the system.
f_bfree Number of free blocks in the file system. The size of a free block is given in the f_bsize field.
f_bavail Number of free blocks available to a nonroot user.
f_files Total number of file nodes in the file system.
f_ffree Number of free file nodes in the file system.
f_fsid File system ID.
f_vfstype Type of this virtual file system. Possible values are:

MNT_JFS
Journaled File System (JFS) of the operating system

MNT_NFS
SUN network file system

MNT_CDROM
CD-ROM file system.
f_fsize Fundamental block size of the file system.
f_fname File system name. The value returned by this field depends on the type of file system:

JFS
Value returned is copied from the s_fname field of the superblock (see the filsys.h file format). You can set this value at the time the file system is created by using the mkfs command with the -l flag. This field gives the preferred mount point for the file system.

Note: The s_fname field in the superblock is only 6 bytes wide. Longer names are truncated to fit.

CD-ROM
The field is filled with null bytes because the f_fname field is not implemented.

NFS
The field is filled with null bytes because the f_fname field is not implemented.
f_fpack File system pack name. The value returned by this field depends on the file system type:

JFS
The value returned is copied from the s_fpack field of the superblock (see the filsys.h file format). You can set this value at the time the file system is created using the mkfs command with the -v flag.

Note: The s_fpack field in the superblock is only 6 bytes wide. Longer pack names are truncated to fit.

CD-ROM
The value is copied from the volume identifier field in the primary volume descriptor.

NFS
The field is filled with null bytes because the f_fname field is not implemented.
f_name_max Maximum length of a component name for this file system.

Note: Fields that are not defined for a particular file system are set to a value of -1.

The ustat system returns information on a mounted file system in the form of a ustat structure. The ustat structure, which is defined in the /usr/include/ustat.h file, contains the following fields:

f_tfree Total number of free blocks in the file system. The size of a free block is given in by the UBSIZE constant. See the param.h file for a description of UBSIZE.
f_inode Number of free i-nodes in the file system.
f_fname File system name.
f_fpack File system pack name.

Implementation Specifics

This file is part of Base Operating System (BOS) Runtime.

Files


statfs.h Path to the statfs.h file.
ustat.h Path to the ustat.h file.

Related Information

The filsys.h file format, param.h file, vmount.h file.

The statfs, fstatfs, or ustat subroutine.

The Header Files Overview defines header files, describes how they are used, and lists several of the documented header files.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]