ustat(2)
NAME
ustat − get file system statistics
SYNOPSIS
#include <ustat.h>
int ustat(dev_t dev, struct ustat *buf);
DESCRIPTION
ustat() returns information about a mounted file system. dev is a device number identifying a device containing a mounted file system. buf is a pointer to a ustat structure (defined in <ustat.h>) that includes the following elements:
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free inodes */
char f_fname[6]; /* Filsys name */
char f_fpack[6]; /* Filsys pack name */
int f_blksize; /* Block size */
The values of the f_tfree and f_blksize fields are reported in fragment size units.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
ERRORS
ustat() fails if one or more of the following is true:
[EINVAL] dev is not the device number of a device containing a mounted file system.
[EFAULT] buf points outside the process’s allocated address space. The reliable detection of this error is implementation dependent.
AUTHOR
ustat() was developed by AT&T and HP.
SEE ALSO
STANDARDS CONFORMANCE
ustat(): SVID2, XPG2
Hewlett-Packard Company — HP-UX Release 9.0: August 1992