2 .\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH USTAT 2 "Jul 23, 2001"
8 ustat \- get file system statistics
12 #include <sys/types.h>
15 \fBint\fR \fBustat\fR(\fBdev_t\fR \fIdev\fR, \fBstruct ustat *\fR\fIbuf\fR);
21 The \fBustat()\fR function returns information about a mounted file system.
22 The \fIdev\fR argument is a device number identifying a device containing a
23 mounted file system (see \fBmakedev\fR(3C)). The \fIbuf\fR argument is a
24 pointer to a \fBustat\fR structure that includes the following members:
28 daddr_t f_tfree; /* Total free blocks */
29 ino_t f_tinode; /* Number of free inodes */
30 char f_fname[6]; /* Filsys name */
31 char f_fpack[6]; /* Filsys pack name */
37 The \fBf_fname\fR and \fBf_fpack\fR members may not contain significant
38 information on all systems; in this case, these members will contain the null
39 character as the first character.
43 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
44 returned and \fBerrno\fR is set to indicate the error.
48 The \fBustat()\fR function will fail if:
55 The \fIdev\fR argument is on a remote machine and the link to that machine is
65 The \fIbuf\fR argument points to an illegal address.
74 A signal was caught during the execution of the \fBustat()\fR function.
83 The \fIdev\fR argument is not the device number of a device containing a
93 The \fIdev\fR argument refers to a device on a remote machine and the link to
94 that machine is no longer active.
100 \fB\fBEOVERFLOW\fR\fR
103 One of the values returned cannot be represented in the structure pointed to by
110 The \fBstatvfs\fR(2) function should be used in favor of \fBustat()\fR.
114 \fBstat\fR(2), \fBstatvfs\fR(2), \fBmakedev\fR(3C), \fBlfcompile\fR(5)
118 The \fBNFS\fR revision 2 protocol does not permit the number of free files to
119 be provided to the client; therefore, when \fBustat()\fR has completed on an
120 \fBNFS\fR file system, \fBf_tinode\fR is always \fB\(mi1\fR\&.