ustat
Purpose
Gets file system statistics.
Syntax
#include <sys/types.h>
#include <ustat.h>
int ustat (dev, buf)
dev_t dev;
struct ustat *buf;
Description
The ustat system call gets information about the mounted
file system identified by device number dev. The dev
parameter is the ID of the device, and it corresponds to
the st_dev member of the structure returned by the stat
and fullstat system calls. If the high-order bits of the
device number are zero, then the device is a local
device. If the high-order bits of the device number are
nonzero, then the calling node queries the remote node
over the connection identified by these 16 bits. See
"fullstat, ffullstat," "stat, fstat," "fullstat.h," and
"stat.h" for more information about the device ID. The
information is stored into a structure pointed to by the
buf parameter.
The ustat structure pointed to by the buf parameter is
defined in the ustat.h file, and it contains the fol-
lowing members:
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free i-nodes */
char f_fname[6]; /* File system name */
char f_fpack[6]; /* File system pack name */
Return Value
Upon successful completion, a value of 0 is returned. If
the ustat system call fails, a value of -1 is returned
and errno is set to indicate the error.
Diagnostics
The ustat system call fails if one or more of the fol-
lowing are true:
EINVAL dev is not the device number of a device con-
taining a mounted file system.
EFAULT The buf parameter &pointsout..
If Distributed Services is installed on your system,
ustat can also fail if one or more of the following are
true:
EDIST The server has blocked new inbound
requests.
EDIST Outbound requests are currently blocked.
EAGAIN The server is too busy to accept the
request.
ESTALE dev identifies a remote device that can no
longer be reached.
ENOMEM Either this node or the server does not
have enough memory available to service the
request.
EBADCONNECT An attempt to use an existing network con-
nection with a remote node failed.
Related Information
In this book: "fullstat, ffullstat," "stat, fstat," and
"fs."