]>
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. | |
11 | .\" | |
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. | |
19 | .\" | |
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 | .\" | |
28 | .TH USTAT 2 2003-08-04 "Linux 2.4" "Linux Programmer's Manual" | |
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 ); | |
40 | .SH DESCRIPTION | |
e511ffb6 | 41 | .BR ustat () |
fea681da MK |
42 | returns information about a mounted file system. |
43 | .I dev | |
44 | is a device number identifying a device containing | |
45 | a mounted file system. | |
46 | .I ubuf | |
cf0a9ace | 47 | is a pointer to a \fIustat\fP structure that contains the following |
fea681da | 48 | members: |
fea681da MK |
49 | .RS |
50 | .nf | |
cf0a9ace MK |
51 | |
52 | daddr_t f_tfree; /* Total free blocks */ | |
53 | ino_t f_tinode; /* Number of free inodes */ | |
54 | char f_fname[6]; /* Filsys name */ | |
55 | char f_fpack[6]; /* Filsys pack name */ | |
fea681da MK |
56 | .fi |
57 | .RE | |
58 | .PP | |
fea681da | 59 | The last two fields, f_fname and f_fpack, are not implemented and will |
28d88c17 | 60 | always be filled with null bytes ('\\0'). |
fea681da MK |
61 | .SH "RETURN VALUE" |
62 | On success, zero is returned and the ustat structure pointed to by | |
63 | .I ubuf | |
64 | will be filled in. On error, \-1 is returned, and | |
65 | .I errno | |
66 | is set appropriately. | |
67 | .SH ERRORS | |
68 | .TP | |
69 | .B EFAULT | |
70 | .I ubuf | |
71 | points outside of your accessible address space. | |
72 | .TP | |
73 | .B EINVAL | |
74 | .I dev | |
75 | does not refer to a device containing a mounted file system. | |
76 | .TP | |
77 | .B ENOSYS | |
78 | The mounted file system referenced by | |
79 | .I dev | |
80 | does not support this operation, or any version of Linux before | |
81 | 1.3.16. | |
82 | .SH "CONFORMING TO" | |
97c1eac8 MK |
83 | SVr4. |
84 | .\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR | |
85 | .\" but has no ENOSYS condition. | |
fea681da | 86 | .SH NOTES |
e511ffb6 | 87 | .BR ustat () |
fea681da MK |
88 | is deprecated and has only been provided for compatibility. |
89 | All new programs should use | |
90 | .BR statfs (2) | |
91 | instead. | |
97c1eac8 MK |
92 | .SH "HP-UX NOTES" |
93 | The HP-UX version of the | |
94 | .I ustat | |
95 | structure has an additional field, | |
96 | .IR f_blksize , | |
97 | that is unknown elsewhere. | |
98 | HP-UX warns: | |
fea681da | 99 | For some file systems, the number of free inodes does not change. |
8729177b | 100 | Such file systems will return \-1 in the field |
fea681da MK |
101 | .IR f_tinode . |
102 | .\" Some software tries to use this in order to test whether the | |
103 | .\" underlying filesystem is NFS. | |
104 | For some file systems, inodes are dynamically allocated. | |
105 | Such file systems will return the current number of free inodes. | |
106 | .SH "SEE ALSO" | |
107 | .BR stat (2), | |
108 | .BR statfs (2) |