fstatfs

Obtains statistics for the file system (volume) specified by a file descriptor.

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

Syntax

  #include <sys/statfs.h> 
   
  int fstatfs (
     int              fildes,
     struct statfs   *buf );
  

Parameters

fildes

(IN) Specifies a file descriptor on which a file is opened on the volume from which to gather statistics.

buf

(OUT) Points to the address of the structure statfs.

Return Values

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

Decimal

Constant

Description

4

EBADF

The fides parameter does not specify an open file.

105

ENOCONTEXT

The calling thread has no context.

Remarks

The fstatfs function obtains statistics about the file system specified by the file descriptor. This information is placed in the 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

statfs