USTAT(2) System Calls Manual USTAT(2)
ustat - get file system statistics
int ustat(dev, buf)
struct ustat *buf;
ustat() returns information about a mounted file system. dev is a
device number identifying a device containing a mounted file system.
This is normally the value returned in the st_dev field of a stat
structure when a stat(), fstat(), or lstat() call is made on a file on
that file system. buf is a pointer to a ustat structure that includes
the following elements:
daddr_t f_tfree; /* Total blocks available to non-super-user */
ino_t f_tinode; /* Number of free files */
char f_fname; /* Filsys name */
char f_fpack; /* Filsys pack name */
The f_fname and f_fpack fields are always set to a null string. Other
fields that are undefined for a particular file system are set to -1.
0 on success.
-1 on failure and sets errno to indicate the error.
EFAULT buf points to an invalid address.
EINVAL dev is not the device number of a device containing a
mounted file system.
EIO An I/O error occurred while reading from or writing to
the file system.
The NFS revision 2 protocol does not permit the number of free files to
be provided to the client; thus, when ustat() is done on an NFS file
system, f_tinode is always -1.
21 January 1990 USTAT(2)