1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Created 1995-08-09 Thomas K. Dyas <tdyas@eden.rutgers.edu>
26 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
27 .\" Modified 2001-03-22 by aeb
28 .\" Modified 2003-08-04 by aeb
30 .TH USTAT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
32 ustat \- get filesystem statistics
35 .B #include <sys/types.h>
36 .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 filesystem.
45 is a device number identifying a device containing
50 structure that contains the following
55 daddr_t f_tfree; /* Total free blocks */
56 ino_t f_tinode; /* Number of free inodes */
57 char f_fname[6]; /* Filsys name */
58 char f_fpack[6]; /* Filsys pack name */
66 are not implemented and will
67 always be filled with null bytes (\(aq\e0\(aq).
69 On success, zero is returned and the
71 structure pointed to by
74 On error, \-1 is returned, and
76 is set to indicate the error.
81 points outside of your accessible address space.
85 does not refer to a device containing a mounted filesystem.
88 The mounted filesystem referenced by
90 does not support this operation, or any version of Linux before
93 Since version 2.28, glibc no longer provides a wrapper for this system call.
96 .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
97 .\" but has no ENOSYS condition.
100 is deprecated and has been provided only for compatibility.
101 All new programs should use
105 The HP-UX version of the
107 structure has an additional field,
109 that is unknown elsewhere.
111 For some filesystems, the number of free inodes does not change.
112 Such filesystems will return \-1 in the field
114 .\" Some software tries to use this in order to test whether the
115 .\" underlying filesystem is NFS.
116 For some filesystems, inodes are dynamically allocated.
117 Such filesystems will return the current number of free inodes.