1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Created 1995-08-09 Thomas K. Dyas <tdyas@eden.rutgers.edu>
24 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified 2001-03-22 by aeb
26 .\" Modified 2003-08-04 by aeb
28 .TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual"
30 ustat \- get file system statistics
33 .B #include <sys/types.h>
35 .BR "#include <unistd.h>" " /* libc[45] */"
37 .BR "#include <ustat.h>" " /* glibc2 */"
39 .BI "int ustat(dev_t " dev ", struct ustat *" ubuf );
43 returns information about a mounted file system.
45 is a device number identifying a device containing
46 a mounted file system.
48 is a pointer to a \fIustat\fP structure that contains the following
53 daddr_t f_tfree; /* Total free blocks */
54 ino_t f_tinode; /* Number of free inodes */
55 char f_fname[6]; /* Filsys name */
56 char f_fpack[6]; /* Filsys pack name */
64 are not implemented and will
65 always be filled with null bytes ('\\0').
67 On success, zero is returned and the
69 structure pointed to by
72 On error, \-1 is returned, and
79 points outside of your accessible address space.
83 does not refer to a device containing a mounted file system.
86 The mounted file system referenced by
88 does not support this operation, or any version of Linux before
92 .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
93 .\" but has no ENOSYS condition.
96 is deprecated and has only been provided for compatibility.
97 All new programs should use
101 The HP-UX version of the
103 structure has an additional field,
105 that is unknown elsewhere.
107 For some file systems, the number of free inodes does not change.
108 Such file systems will return \-1 in the field
110 .\" Some software tries to use this in order to test whether the
111 .\" underlying filesystem is NFS.
112 For some file systems, inodes are dynamically allocated.
113 Such file systems will return the current number of free inodes.