Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#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[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.
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
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.
The buf argument points to an illegal address.
A signal was caught during the execution of the ustat() function.
The dev argument is not the device number of a device containing a mounted file system.
The dev argument refers to a device on a remote machine and the link to that machine is no longer active.
One of the values returned cannot be represented in the structure pointed to by buf.
The statvfs(2) function should be used in favor of ustat().
stat (2), statvfs (2), makedev (3C), lfcompile (7)
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.