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 Since version 2.28, glibc no longer provides a wrapper for this system
44 call.
45
47 SVr4.
48
50 ustat() is deprecated and has been provided only for compatibility.
51 All new programs should use statfs(2) instead.
52
53 HP-UX notes
54 The HP-UX version of the ustat structure has an additional field,
55 f_blksize, that is unknown elsewhere. HP-UX warns: For some filesys‐
56 tems, the number of free inodes does not change. Such filesystems will
57 return -1 in the field f_tinode. For some filesystems, inodes are
58 dynamically allocated. Such filesystems will return the current number
59 of free inodes.
60
62 stat(2), statfs(2)
63
65 This page is part of release 5.02 of the Linux man-pages project. A
66 description of the project, information about reporting bugs, and the
67 latest version of this page, can be found at
68 https://www.kernel.org/doc/man-pages/.
69
70
71
72Linux 2019-03-06 USTAT(2)