1USTAT(2) Linux Programmer's Manual USTAT(2)
2
3
4
6 ustat - get filesystem statistics
7
9 #include <sys/types.h>
10 #include <unistd.h> /* libc[45] */
11 #include <ustat.h> /* glibc2 */
12
13 int ustat(dev_t dev, struct ustat *ubuf);
14
16 ustat() returns information about a mounted filesystem. dev is a
17 device number identifying a device containing a mounted filesystem.
18 ubuf is a pointer to a ustat structure that contains the following mem‐
19 bers:
20
21 daddr_t f_tfree; /* Total free blocks */
22 ino_t f_tinode; /* Number of free inodes */
23 char f_fname[6]; /* Filsys name */
24 char f_fpack[6]; /* Filsys pack name */
25
26 The last two fields, f_fname and f_fpack, are not implemented and will
27 always be filled with null bytes ('\0').
28
30 On success, zero is returned and the ustat structure pointed to by ubuf
31 will be filled in. On error, -1 is returned, and errno is set appro‐
32 priately.
33
35 EFAULT ubuf points outside of your accessible address space.
36
37 EINVAL dev does not refer to a device containing a mounted filesystem.
38
39 ENOSYS The mounted filesystem referenced by dev does not support this
40 operation, or any version of Linux before 1.3.16.
41
43 SVr4.
44
46 ustat() is deprecated and has been provided only for compatibility.
47 All new programs should use statfs(2) instead.
48
49 HP-UX notes
50 The HP-UX version of the ustat structure has an additional field,
51 f_blksize, that is unknown elsewhere. HP-UX warns: For some filesys‐
52 tems, the number of free inodes does not change. Such filesystems will
53 return -1 in the field f_tinode. For some filesystems, inodes are
54 dynamically allocated. Such filesystems will return the current number
55 of free inodes.
56
58 stat(2), statfs(2)
59
61 This page is part of release 4.16 of the Linux man-pages project. A
62 description of the project, information about reporting bugs, and the
63 latest version of this page, can be found at
64 https://www.kernel.org/doc/man-pages/.
65
66
67
68Linux 2017-09-15 USTAT(2)