ustat - get file system statistics
#include <sys/types.h> #include <ustat.h> int ustat(dev_t dev, struct ustat *buf);
The ustat() function returns information about a mounted file system. The dev argument is a device number identifying a device containing a mounted file system (see makedev(3C)). The buf argument is a pointer to a ustat structure that includes the following members:
daddr_t f_tfree; /* Total free blocks */ ino_t f_tinode; /* Number of free inodes */ char f_fname; /* Filsys name */ char f_fpack; /* Filsys pack name */
The f_fname and f_fpack members may not contain significant information on all systems; in this case, these members will contain the null character as the first character.
Upon successful completion, 0 is returned. Otherwise, −1 is returned and errno is set to indicate the error.
The ustat() function will fail if:
The statvfs(2) function should be used in favor of ustat().
The NFS revision 2 protocol does not permit the number of free files to be provided to the client; therefore, when ustat() has completed on an NFS file system, f_tinode is always −1.
|July 23, 2001||OmniOS|