statfs

Retrieves the statistics for the file system (volume) containing the specified file or directory.

Library:LibC
Classification:Other
Service:File and Directory I/O

Syntax

  #include <sys/statfs.h>
   
  int statfs (
     const char      *path,
     struct statfs   *buf );
  

Parameters

path

(IN) Points to a string containing the path name to any file or directory in the volume for which statistics are to be obtained.

buf

(OUT) Points to the structure containing statistics about the file system.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:

Decimal

Constant

Description

77

ESRCH

The volume does not exist.

105

ENOCONTEXT

The calling thread has no context.

Remarks

The statfs function returns information in the statfs structure located at the address indicated by the buf parameter.

The sys/statfs.h header file contains definitions for the statfs structure and the fields are described in statfs.

IMPORTANT:This function returns information only for traditional and NSS volumes which are mounted. It does not currently return information about the DOS partition.

See Also

fstatfs