Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ustat(2) — SunOS 4.1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2V)

statfs(2)

USTAT(2)  —  SYSTEM CALLS

NAME

ustat − get file system statistics

SYNOPSIS

#include <sys/types.h>
#include <ustat.h>

int ustat(dev, buf)
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.  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_tf_tfree; /∗ Total blocks available to non-super-user ∗/
ino_tf_tinode;/∗ Number of free files ∗/
charf_fname[6];/∗ Filsys name ∗/
charf_fpack[6];/∗ 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. 

RETURN VALUES

ustat() returns:

0 on success. 

−1 on failure and sets errno to indicate the error. 

ERRORS

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. 

SEE ALSO

stat(2V), statfs(2)

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. 

Sun Release 4.1  —  Last change: 21 January 1990

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