source: trunk/sys/dietlibc/include/sys/statfs.h @ 1

Last change on this file since 1 was 1, checked in by alain, 7 years ago

First import

File size: 3.5 KB
Line 
1#ifndef _SYS_STATFS_H
2#define _SYS_STATFS_H
3
4#include <sys/cdefs.h>
5#include <endian.h>
6#include <sys/types.h>
7
8__BEGIN_DECLS
9
10typedef struct {
11  int32_t __val[2];
12} __kernel_fsid_t;
13
14#if defined(__mips64__)
15
16struct statfs {
17  int64_t               f_type;
18#define f_fstyp f_type
19  int64_t               f_bsize;
20  int64_t               f_frsize;       /* Fragment size - unsupported */
21  int64_t               f_blocks;
22  int64_t               f_bfree;
23  int64_t               f_files;
24  int64_t               f_ffree;
25  int64_t               f_bavail;
26
27  /* Linux specials */
28  __kernel_fsid_t       f_fsid;
29  int64_t               f_namelen;
30  int64_t               f_spare[6];
31};
32
33struct statfs64 {                       /* Same as struct statfs */
34  int64_t               f_type;
35  int64_t               f_bsize;
36  int64_t               f_frsize;       /* Fragment size - unsupported */
37  int64_t               f_blocks;
38  int64_t               f_bfree;
39  int64_t               f_files;
40  int64_t               f_ffree;
41  int64_t               f_bavail;
42
43  /* Linux specials */
44  __kernel_fsid_t       f_fsid;
45  int64_t               f_namelen;
46  int64_t               f_spare[6];
47};
48
49#elif defined(__mips__)
50
51struct statfs {
52  int32_t               f_type;
53#define f_fstyp f_type
54  int32_t               f_bsize;
55  int32_t               f_frsize;       /* Fragment size - unsupported */
56  int32_t               f_blocks;
57  int32_t               f_bfree;
58  int32_t               f_files;
59  int32_t               f_ffree;
60  int32_t               f_bavail;
61
62  /* Linux specials */
63  __kernel_fsid_t       f_fsid;
64  int32_t               f_namelen;
65  int32_t               f_spare[6];
66};
67
68struct statfs64 {
69  uint32_t      f_type;
70  uint32_t      f_bsize;
71  uint32_t      f_frsize;       /* Fragment size - unsupported */
72  uint32_t      __pad;
73  uint64_t      f_blocks;
74  uint64_t      f_bfree;
75  uint64_t      f_files;
76  uint64_t      f_ffree;
77  uint64_t      f_bavail;
78  __kernel_fsid_t f_fsid;
79  uint32_t      f_namelen;
80  uint32_t      f_spare[6];
81};
82
83#elif defined(__s390x__)
84
85/* S/390 64-bit mode */
86
87struct statfs {
88  int32_t  f_type;
89  int32_t  f_bsize;
90  int64_t f_blocks;
91  int64_t f_bfree;
92  int64_t f_bavail;
93  int64_t f_files;
94  int64_t f_ffree;
95  __kernel_fsid_t f_fsid;
96  int32_t  f_namelen;
97  int32_t  f_frsize;
98  int32_t  f_spare[5];
99};
100
101struct statfs64 {
102  int32_t  f_type;
103  int32_t  f_bsize;
104  int64_t f_blocks;
105  int64_t f_bfree;
106  int64_t f_bavail;
107  int64_t f_files;
108  int64_t f_ffree;
109  __kernel_fsid_t f_fsid;
110  int32_t  f_namelen;
111  int32_t  f_frsize;
112  int32_t  f_spare[5];
113};
114
115#elif __WORDSIZE == 64
116
117/* generic 64-bit */
118
119struct statfs {
120  int64_t f_type;
121  int64_t f_bsize;
122  int64_t f_blocks;
123  int64_t f_bfree;
124  int64_t f_bavail;
125  int64_t f_files;
126  int64_t f_ffree;
127  __kernel_fsid_t f_fsid;
128  int64_t f_namelen;
129  int64_t f_frsize;
130  int64_t f_spare[5];
131};
132
133struct statfs64 {
134  int64_t f_type;
135  int64_t f_bsize;
136  int64_t f_blocks;
137  int64_t f_bfree;
138  int64_t f_bavail;
139  int64_t f_files;
140  int64_t f_ffree;
141  __kernel_fsid_t f_fsid;
142  int64_t f_namelen;
143  int64_t f_frsize;
144  int64_t f_spare[5];
145};
146
147#else
148
149/* generic 32-bit */
150
151struct statfs {
152  uint32_t f_type;
153  uint32_t f_bsize;
154  uint32_t f_blocks;
155  uint32_t f_bfree;
156  uint32_t f_bavail;
157  uint32_t f_files;
158  uint32_t f_ffree;
159  __kernel_fsid_t f_fsid;
160  uint32_t f_namelen;
161  uint32_t f_frsize;
162  uint32_t f_spare[5];
163};
164
165struct statfs64 {
166  uint32_t f_type;
167  uint32_t f_bsize;
168  uint64_t f_blocks;
169  uint64_t f_bfree;
170  uint64_t f_bavail;
171  uint64_t f_files;
172  uint64_t f_ffree;
173  __kernel_fsid_t f_fsid;
174  uint32_t f_namelen;
175  uint32_t f_frsize;
176  uint32_t f_spare[5];
177};
178
179#endif
180
181int statfs(const char *path, struct statfs *buf) __THROW;
182int fstatfs(int fd, struct statfs *buf) __THROW;
183
184#if __WORDSIZE == 32
185int statfs64(const char *path, struct statfs64 *buf) __THROW;
186int fstatfs64(int fd, struct statfs64 *buf) __THROW;
187
188#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
189#define statfs statfs64
190#define fstatfs fstatfs64
191#endif
192#endif
193
194__END_DECLS
195
196#endif
Note: See TracBrowser for help on using the repository browser.