.TH ustat() "" "" "System Call (libc)"
.PC "Get statistics on a file system"
.B "#include <sys/types.h>"
.B "#include <ustat.h>"
\fBint ustat (\fIdevice\^\fB, \fIbuffer\^\fB)\fR
\fBdev_t \fIdevice\^\fB;\fR
\fBstruct ustat *\fIbuffer\^\fB;\fR
.PP
The \*(CO system call
.B ustat()
returns information about a mounted file system.
.I device
names the device upon which the file system is mounted.
.I buffer
points to a structure of type
.BR ustat ,
which contains the following fields:
.DM
.ta 0.5i 1.5i 3.0i
	daddr_t	f_tfree;	/* number of free blocks */
	ino_t	f_tinode;	/* number of free i-nodes */
	char	f_fname[6];	/* name of the file system */
	char	f_fpack[6];	/* pack name of the file system */
.DE
.PP
Useful information may not be available for fields
.B f_fname
and
.BR f_fpack ;
in that case, they are initialized to nuls.
.PP
.B ustat()
returns zero if all goes well; otherwise, it returns \-1 and sets
.B errno
to an appropriate value.
.B ustat()
can fail for any of the following reasons:
.IP \(bu 0.3i
.I device
does not contain a mounted file system.
.IP \(bu
.I buffer
points to an illegal address.
.IP \(bu
The kernel caught a signal while it was executing the call.
.SH "See Also"
.Xr "libc," libc
.Xr "mkfs," mkfs
.Xr "statfs()" statfs
.SH Note
.B ustat()
is largely superceded by
.BR statfs() .
