COHERENT manpages

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

List of available manpages
Index


fstatfs() -- System Call (libc)

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

The COHERENT system call fstatfs() 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 fstatfs() can write its output.
Always set this to sizeof(struct statfs).

filedes  and  fstype identify  the  file  system.  If  the  file system  is
unmounted, then  filedes should give the file descriptor  for the device by
which the file system is accessed, as returned by a call to creat(), dup(),
open(), or   pipe(); and fstype contains  the type of the  file system.  If
the file system is mounted, then filedes should give the file descriptor of
a file on the file system in question, and fstype must be set to zero.

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

See Also

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