Debian Codegraph @

upstream/debian-trixie/man2/ustat.2

raw
1 .\" Copyright (C) 1995, Thomas K. Dyas <[email protected]>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Created 1995-08-09 Thomas K. Dyas <[email protected]>
6 .\" Modified 1997-01-31 by Eric S. Raymond <[email protected]>
7 .\" Modified 2001-03-22 by aeb
8 .\" Modified 2003-08-04 by aeb
9 .\"
10 .TH ustat 2 2024-06-15 "Linux man-pages 6.9.1"
11 .SH NAME
12 ustat \- get filesystem statistics
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <sys/types.h>
19 .BR "#include <unistd.h>" " /* libc[45] */"
20 .BR "#include <ustat.h>" " /* glibc2 */"
21 .P
22 .BI "[[deprecated]] int ustat(dev_t " dev ", struct ustat *" ubuf );
23 .fi
24 .SH DESCRIPTION
25 .BR ustat ()
26 returns information about a mounted filesystem.
27 .I dev
28 is a device number identifying a device containing
29 a mounted filesystem.
30 .I ubuf
31 is a pointer to a
32 .I ustat
33 structure that contains the following
34 members:
35 .P
36 .in +4n
37 .EX
38 daddr_t f_tfree; /* Total free blocks */
39 ino_t f_tinode; /* Number of free inodes */
40 char f_fname[6]; /* Filsys name */
41 char f_fpack[6]; /* Filsys pack name */
42 .EE
43 .in
44 .P
45 The last two fields,
46 .I f_fname
47 and
48 .IR f_fpack ,
49 are not implemented and will
50 always be filled with null bytes (\[aq]\[rs]0\[aq]).
51 .SH RETURN VALUE
52 On success, zero is returned and the
53 .I ustat
54 structure pointed to by
55 .I ubuf
56 will be filled in.
57 On error, \-1 is returned, and
58 .I errno
59 is set to indicate the error.
60 .SH ERRORS
61 .TP
62 .B EFAULT
63 .I ubuf
64 points outside of your accessible address space.
65 .TP
66 .B EINVAL
67 .I dev
68 does not refer to a device containing a mounted filesystem.
69 .TP
70 .B ENOSYS
71 The mounted filesystem referenced by
72 .I dev
73 does not support this operation,
74 or any version of Linux before Linux 1.3.16.
75 .SH STANDARDS
76 None.
77 .SH HISTORY
78 SVr4.
79 Removed in glibc 2.28.
80 .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
81 .\" but has no ENOSYS condition.
82 .P
83 .BR ustat ()
84 is deprecated and has been provided only for compatibility.
85 All new programs should use
86 .BR statfs (2)
87 instead.
88 .SS HP-UX notes
89 The HP-UX version of the
90 .I ustat
91 structure has an additional field,
92 .IR f_blksize ,
93 that is unknown elsewhere.
94 HP-UX warns:
95 For some filesystems, the number of free inodes does not change.
96 Such filesystems will return \-1 in the field
97 .IR f_tinode .
98 .\" Some software tries to use this in order to test whether the
99 .\" underlying filesystem is NFS.
100 For some filesystems, inodes are dynamically allocated.
101 Such filesystems will return the current number of free inodes.
102 .SH SEE ALSO
103 .BR stat (2),
104 .BR statfs (2)