version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
STATFS |
|
|
2 |
!!!STATFS |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
ERRORS |
|
|
8 |
CONFORMING TO |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
statfs, fstatfs - get file system statistics |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include __ |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
__int statfs(const char *__''path''__, struct statfs |
|
|
22 |
*__''buf''__); |
|
|
23 |
int fstatfs(int__ ''fd''__, struct statfs |
|
|
24 |
*__''buf''__);__ |
|
|
25 |
!!DESCRIPTION |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
__statfs__ returns information about a mounted file |
|
|
29 |
system. ''path'' is the path name of any file within the |
|
|
30 |
mounted filesystem. ''buf'' is a pointer to a |
|
|
31 |
''statfs'' structure defined as follows: |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
struct statfs { |
|
|
35 |
long f_type; /* type of filesystem (see below) */ |
|
|
36 |
long f_bsize; /* optimal transfer block size */ |
|
|
37 |
long f_blocks; /* total data blocks in file system */ |
|
|
38 |
long f_bfree; /* free blocks in fs */ |
|
|
39 |
long f_bavail; /* free blocks avail to non-superuser */ |
|
|
40 |
long f_files; /* total file nodes in file system */ |
|
|
41 |
long f_ffree; /* free file nodes in fs */ |
|
|
42 |
fsid_t f_fsid; /* file system id */ |
|
|
43 |
long f_namelen; /* maximum length of filenames */ |
|
|
44 |
long f_spare[[6]; /* spare for later */ |
|
|
45 |
}; |
|
|
46 |
File system types: |
|
|
47 |
linux/affs_fs.h: |
|
|
48 |
AFFS_SUPER_MAGIC 0xADFF |
|
|
49 |
linux/efs_fs.h: |
|
|
50 |
EFS_SUPER_MAGIC 0x00414A53 |
|
|
51 |
linux/ext_fs.h: |
|
|
52 |
EXT_SUPER_MAGIC 0x137D |
|
|
53 |
linux/ext2_fs.h: |
|
|
54 |
EXT2_OLD_SUPER_MAGIC 0xEF51 |
|
|
55 |
EXT2_SUPER_MAGIC 0xEF53 |
|
|
56 |
linux/hpfs_fs.h: |
|
|
57 |
HPFS_SUPER_MAGIC 0xF995E849 |
|
|
58 |
linux/iso_fs.h: |
|
|
59 |
ISOFS_SUPER_MAGIC 0x9660 |
|
|
60 |
linux/minix_fs.h: |
|
|
61 |
MINIX_SUPER_MAGIC 0x137F /* orig. minix */ |
|
|
62 |
MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ |
|
|
63 |
MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ |
|
|
64 |
MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ |
|
|
65 |
linux/msdos_fs.h: |
|
|
66 |
MSDOS_SUPER_MAGIC 0x4d44 |
|
|
67 |
linux/ncp_fs.h: |
|
|
68 |
NCP_SUPER_MAGIC 0x564c |
|
|
69 |
linux/nfs_fs.h: |
|
|
70 |
NFS_SUPER_MAGIC 0x6969 |
|
|
71 |
linux/proc_fs.h: |
|
|
72 |
PROC_SUPER_MAGIC 0x9fa0 |
|
|
73 |
linux/smb_fs.h: |
|
|
74 |
SMB_SUPER_MAGIC 0x517B |
|
|
75 |
linux/sysv_fs.h: |
|
|
76 |
XENIX_SUPER_MAGIC 0x012FF7B4 |
|
|
77 |
SYSV4_SUPER_MAGIC 0x012FF7B5 |
|
|
78 |
SYSV2_SUPER_MAGIC 0x012FF7B6 |
|
|
79 |
COH_SUPER_MAGIC 0x012FF7B7 |
|
|
80 |
linux/ufs_fs.h: |
|
|
81 |
UFS_MAGIC 0x00011954 |
|
|
82 |
linux/xfs_fs.h: |
|
|
83 |
XFS_SUPER_MAGIC 0x58465342 |
|
|
84 |
linux/xia_fs.h: |
|
|
85 |
_XIAFS_SUPER_MAGIC 0x012FD16D |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Fields that are undefined for a particular file system are |
|
|
89 |
set to 0. __fstatfs__ returns the same information about |
|
|
90 |
an open file referenced by descriptor |
|
|
91 |
''fd''. |
|
|
92 |
!!RETURN VALUE |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
On success, zero is returned. On error, -1 is returned, and |
|
|
96 |
''errno'' is set appropriately. |
|
|
97 |
!!ERRORS |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
For __statfs__: |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
__ENOTDIR__ |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
A component of the path prefix of ''path'' is not a |
|
|
107 |
directory. |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
__ENAMETOOLONG__ |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
''path'' is too long. |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
__ENOENT__ |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
The file referred to by ''path'' does not |
|
|
120 |
exist. |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
__EACCES__ |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
Search permission is denied for a component of the path |
|
|
127 |
prefix of ''path''. |
|
|
128 |
|
|
|
129 |
|
|
|
130 |
__ELOOP__ |
|
|
131 |
|
|
|
132 |
|
|
|
133 |
Too many symbolic links were encountered in translating |
|
|
134 |
''path''. |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
__EFAULT__ |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
''Buf'' or ''path'' points to an invalid |
|
|
141 |
address. |
|
|
142 |
|
|
|
143 |
|
|
|
144 |
__EIO__ |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
An I/O error occurred while reading from or writing to the |
|
|
148 |
file system. |
|
|
149 |
|
|
|
150 |
|
|
|
151 |
__ENOMEM__ |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
Insufficient kernel memory was available. |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
__ENOSYS__ |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
The filesystem ''path'' is on does not support |
|
|
161 |
__statfs__. |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
For __fstatfs__: |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
__EBADF__ |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
''fd'' is not a valid open file descriptor. |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__EFAULT__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
''buf'' points to an invalid address. |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__EIO__ |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
An I/O error occurred while reading from or writing to the |
|
|
183 |
file system. |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
__ENOSYS__ |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
The filesystem ''fd'' is open on does not support |
|
|
190 |
__statfs__. |
|
|
191 |
!!CONFORMING TO |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
The Linux __statfs__ was inspired by the 4.4BSD one (but |
|
|
195 |
they do not use the same structure). |
|
|
196 |
!!SEE ALSO |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
stat(2) |
|
|
200 |
---- |