COHERENT manpages

This page displays the COHERENT manpage for statfs() [Get information about a file system].

List of available manpages
Index


statfs() -- System Call (libc)

Get information about a file system
#include <sys/types.h>
#include <sys/statfs.h>
int statfs (path, buffer, length, fstype)
char *path;
struct statfs *buffer;
int length, fstype;

The COHERENT system call  statfs() returns information about a file system,
either mounted or unmounted.

buffer points  to a structure of type statfs,  which contains the following
members:

     short     f_fstyp;       /* type of the file system */
     short     f_bsize;       /* block size */
     short     f_frsize;      /* fragment size */
     long      f_blocks;      /* number of blocks in the file system */
     long      f_bfree;       /* number of free blocks */
     long      f_files;       /* number of file nodes */
     long      f_ffree;       /* number of free file nodes */
     char      f_fname[6];    /* name of the volume */
     char      f_fpack[6];    /* name of the pack */

length is the length of the  area into which statfs() can write its output.
This should always be set to sizeof(struct statfs).

path and fstype identify the file system.  If the file system is unmounted,
then path should name the device  by which the file system is accessed, and
fstype should contain  the type of the file system.   If the file system is
mounted, then  path should give  the full path  name of a file  on the file
system in question, and fstype must be set to zero.

statfs()  returns zero  if  all went  well.   If something  went wrong,  it
returns -1 and sets errno to an appropriate value.

See Also

fstatfs(),
libc,
mkfs,
statfs.h,
ustat()