Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ustat(2) [opensolaris man page]

ustat(2)							   System Calls 							  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
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[6]; /* Filsys name */ char f_fpack[6]; /* 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. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The ustat() function will fail if: ECOMM The dev argument is on a remote machine and the link to that machine is no longer active. EFAULT The buf argument points to an illegal address. EINTR A signal was caught during the execution of the ustat() function. EINVAL The dev argument is not the device number of a device containing a mounted file system. ENOLINK The dev argument refers to a device on a remote machine and the link to that machine is no longer active. EOVERFLOW One of the values returned cannot be represented in the structure pointed to by buf. USAGE
The statvfs(2) function should be used in favor of ustat(). SEE ALSO
stat(2), statvfs(2), makedev(3C), lfcompile(5) BUGS
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. SunOS 5.11 23 Jul 2001 ustat(2)

Check Out this Related Man Page

USTAT(2)						     Linux Programmer's Manual							  USTAT(2)

NAME
ustat - get file system statistics SYNOPSIS
#include <sys/types.h> #include <unistd.h> /* libc[45] */ #include <ustat.h> /* glibc2 */ int ustat(dev_t dev, struct ustat *ubuf); DESCRIPTION
ustat() returns information about a mounted file system. dev is a device number identifying a device containing a mounted file system. ubuf is a pointer to a ustat structure that contains the following members: daddr_t f_tfree; /* Total free blocks */ ino_t f_tinode; /* Number of free inodes */ char f_fname[6]; /* Filsys name */ char f_fpack[6]; /* Filsys pack name */ The last two fields, f_fname and f_fpack, are not implemented and will always be filled with null bytes (''). RETURN VALUE
On success, zero is returned and the ustat structure pointed to by ubuf will be filled in. On error, -1 is returned, and errno is set appropriately. ERRORS
EFAULT ubuf points outside of your accessible address space. EINVAL dev does not refer to a device containing a mounted file system. ENOSYS The mounted file system referenced by dev does not support this operation, or any version of Linux before 1.3.16. CONFORMING TO
SVr4. NOTES
ustat() is deprecated and has only been provided for compatibility. All new programs should use statfs(2) instead. HP-UX Notes The HP-UX version of the ustat structure has an additional field, f_blksize, that is unknown elsewhere. HP-UX warns: For some file sys- tems, the number of free inodes does not change. Such file systems will return -1 in the field f_tinode. For some file systems, inodes are dynamically allocated. Such file systems will return the current number of free inodes. SEE ALSO
stat(2), statfs(2) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2003-08-04 USTAT(2)
Man Page