Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2)

statvfs(2)

makedev(3C)

ustat(2)

NAME

ustat − get file system statistics

SYNOPSIS

#include <sys/types.h>
#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 (see makedev(3C)).  buf is a pointer to a ustat() structure that includes the following elements:

daddr_tf_tfree;/∗ Total free blocks ∗/
ino_tf_tinode;/∗ Number of free inodes ∗/
charf_fname[6];/∗ Filsys name ∗/
charf_fpack[6];/∗ Filsys pack name ∗/

The last two fields, f_fname and f_fpack may not have significant information on all systems, and in that case, will contain the null character as the first character of these fields. 

RETURN VALUES

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 are true:

ECOMM dev is on a remote machine and the link to that machine is no longer active. 

EFAULT buf points to an illegal address. 

EINTR A signal was caught during a ustat() function. 

EINVAL dev is not the device number of a device containing a mounted file system. 

ENOLINK dev is on a remote machine and the link to that machine is no longer active. 

SEE ALSO

stat(2), statvfs(2), makedev(3C)

NOTES

ustat() will be phased out in favor of the statvfs(2) function. 

BUGS

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. 

SunOS 5.1/SPARC  —  Last change: 29 Jul 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026