]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu> |
2 | .\" | |
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. | |
6 | .\" | |
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. | |
c13182ef | 11 | .\" |
fea681da MK |
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 | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
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 | |
27 | .\" | |
d9343c5c | 28 | .TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual" |
fea681da MK |
29 | .SH NAME |
30 | ustat \- get file system statistics | |
31 | .SH SYNOPSIS | |
32 | .nf | |
33 | .B #include <sys/types.h> | |
34 | .br | |
35 | .BR "#include <unistd.h>" " /* libc[45] */" | |
36 | .br | |
37 | .BR "#include <ustat.h>" " /* glibc2 */" | |
38 | .sp | |
39 | .BI "int ustat(dev_t " dev ", struct ustat *" ubuf ); | |
c8250206 | 40 | .fi |
fea681da | 41 | .SH DESCRIPTION |
e511ffb6 | 42 | .BR ustat () |
fea681da MK |
43 | returns information about a mounted file system. |
44 | .I dev | |
45 | is a device number identifying a device containing | |
46 | a mounted file system. | |
47 | .I ubuf | |
cf0a9ace | 48 | is a pointer to a \fIustat\fP structure that contains the following |
fea681da | 49 | members: |
c8250206 | 50 | .in +4n |
fea681da | 51 | .nf |
cf0a9ace MK |
52 | |
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 */ | |
fea681da | 57 | .fi |
c8250206 | 58 | .in |
fea681da | 59 | .PP |
3b5dffbc MK |
60 | The last two fields, |
61 | .I f_fname | |
62 | and | |
63 | .IR f_fpack , | |
64 | are not implemented and will | |
f81fb444 | 65 | always be filled with null bytes (\(aq\\0\(aq). |
47297adb | 66 | .SH RETURN VALUE |
3b5dffbc MK |
67 | On success, zero is returned and the |
68 | .I ustat | |
69 | structure pointed to by | |
fea681da | 70 | .I ubuf |
c13182ef MK |
71 | will be filled in. |
72 | On error, \-1 is returned, and | |
fea681da MK |
73 | .I errno |
74 | is set appropriately. | |
75 | .SH ERRORS | |
76 | .TP | |
77 | .B EFAULT | |
78 | .I ubuf | |
79 | points outside of your accessible address space. | |
80 | .TP | |
81 | .B EINVAL | |
82 | .I dev | |
83 | does not refer to a device containing a mounted file system. | |
84 | .TP | |
85 | .B ENOSYS | |
86 | The mounted file system referenced by | |
87 | .I dev | |
88 | does not support this operation, or any version of Linux before | |
89 | 1.3.16. | |
47297adb | 90 | .SH CONFORMING TO |
c13182ef | 91 | SVr4. |
97c1eac8 MK |
92 | .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR |
93 | .\" but has no ENOSYS condition. | |
fea681da | 94 | .SH NOTES |
e511ffb6 | 95 | .BR ustat () |
fea681da MK |
96 | is deprecated and has only been provided for compatibility. |
97 | All new programs should use | |
98 | .BR statfs (2) | |
99 | instead. | |
c634028a | 100 | .SS "HP-UX notes" |
97c1eac8 | 101 | The HP-UX version of the |
c13182ef | 102 | .I ustat |
97c1eac8 MK |
103 | structure has an additional field, |
104 | .IR f_blksize , | |
c13182ef | 105 | that is unknown elsewhere. |
97c1eac8 | 106 | HP-UX warns: |
fea681da | 107 | For some file systems, the number of free inodes does not change. |
8729177b | 108 | Such file systems will return \-1 in the field |
fea681da MK |
109 | .IR f_tinode . |
110 | .\" Some software tries to use this in order to test whether the | |
24d01c53 | 111 | .\" underlying file system is NFS. |
fea681da MK |
112 | For some file systems, inodes are dynamically allocated. |
113 | Such file systems will return the current number of free inodes. | |
47297adb | 114 | .SH SEE ALSO |
fea681da MK |
115 | .BR stat (2), |
116 | .BR statfs (2) |