@@ -14,12 +14,12 @@ pub type nlink_t = ::c_uint;
14
14
pub type off_t = :: c_long ;
15
15
pub type rlim_t = c_ulong ;
16
16
pub type rlim64_t = u64 ;
17
+ // [uClibc docs] Note stat64 has the same shape as stat for x86-64.
18
+ pub type stat64 = stat ;
17
19
pub type suseconds_t = :: c_long ;
18
20
pub type time_t = :: c_int ;
19
21
pub type wchar_t = :: c_int ;
20
22
21
- // ToDo, used?
22
- //pub type d_ino = ::c_ulong;
23
23
pub type nfds_t = :: c_ulong ;
24
24
25
25
s ! {
@@ -136,57 +136,33 @@ s! {
136
136
// __align: [u32; 0],
137
137
// }
138
138
139
- pub struct stat { // ToDo
139
+ pub struct stat {
140
140
pub st_dev: :: c_ulong,
141
- st_pad1: [ :: c_long; 2 ] ,
142
141
pub st_ino: :: ino_t,
143
- pub st_mode: :: mode_t,
142
+ // According to uclibc/libc/sysdeps/linux/x86_64/bits/stat.h, order of nlink and mode are
143
+ // swapped on 64 bit systems.
144
144
pub st_nlink: :: nlink_t,
145
+ pub st_mode: :: mode_t,
145
146
pub st_uid: :: uid_t,
146
147
pub st_gid: :: gid_t,
147
- pub st_rdev: u64 ,
148
- pub st_pad2 : [ u64 ; 1 ] ,
149
- pub st_size : off_t ,
150
- st_pad3 : :: c_long ,
148
+ pub st_rdev: :: c_ulong , // dev_t
149
+ pub st_size : off_t , // file size
150
+ pub st_blksize : :: blksize_t ,
151
+ pub st_blocks : :: blkcnt_t ,
151
152
pub st_atime: :: time_t,
152
- pub st_atime_nsec: :: c_long ,
153
+ pub st_atime_nsec: :: c_ulong ,
153
154
pub st_mtime: :: time_t,
154
- pub st_mtime_nsec: :: c_long ,
155
+ pub st_mtime_nsec: :: c_ulong ,
155
156
pub st_ctime: :: time_t,
156
- pub st_ctime_nsec: :: c_long,
157
- pub st_blksize: :: blksize_t,
158
- st_pad4: :: c_long,
159
- pub st_blocks: :: blkcnt_t,
160
- st_pad5: [ :: c_long; 7 ] ,
161
- }
162
-
163
- pub struct statvfs { // ToDo: broken
164
- pub f_bsize: :: c_ulong,
165
- pub f_frsize: :: c_ulong,
166
- pub f_blocks: :: fsblkcnt_t,
167
- pub f_bfree: :: fsblkcnt_t,
168
- pub f_bavail: :: fsblkcnt_t,
169
- pub f_files: :: fsfilcnt_t,
170
- pub f_ffree: :: fsfilcnt_t,
171
- pub f_favail: :: fsfilcnt_t,
172
- #[ cfg( target_endian = "little" ) ]
173
- pub f_fsid: :: c_ulong,
174
- #[ cfg( target_pointer_width = "32" ) ]
175
- __f_unused: :: c_int,
176
- #[ cfg( target_endian = "big" ) ]
177
- pub f_fsid: :: c_ulong,
178
- pub f_flag: :: c_ulong,
179
- pub f_namemax: :: c_ulong,
180
- __f_spare: [ :: c_int; 6 ] ,
157
+ pub st_ctime_nsec: :: c_ulong,
158
+ st_pad4: [ :: c_long; 3 ]
181
159
}
182
160
183
- pub struct sigaction { // TODO!!
184
- pub sa_sigaction: :: sighandler_t,
161
+ pub struct sigaction {
162
+ pub sa_handler: :: sighandler_t,
163
+ pub sa_flags: :: c_ulong,
164
+ pub sa_restorer: * mut :: c_void,
185
165
pub sa_mask: :: sigset_t,
186
- #[ cfg( target_arch = "sparc64" ) ]
187
- __reserved0: :: c_int,
188
- pub sa_flags: :: c_int,
189
- _restorer: * mut :: c_void,
190
166
}
191
167
192
168
pub struct stack_t { // ToDo
@@ -311,27 +287,6 @@ s! {
311
287
__unused5: * mut :: c_void,
312
288
}
313
289
314
- pub struct stat64 { // ToDo
315
- pub st_dev: :: dev_t,
316
- pub st_ino: :: ino64_t,
317
- pub st_nlink: :: nlink_t,
318
- pub st_mode: :: mode_t,
319
- pub st_uid: :: uid_t,
320
- pub st_gid: :: gid_t,
321
- __pad0: :: c_int,
322
- pub st_rdev: :: dev_t,
323
- pub st_size: :: off_t,
324
- pub st_blksize: :: blksize_t,
325
- pub st_blocks: :: blkcnt64_t,
326
- pub st_atime: :: time_t,
327
- pub st_atime_nsec: :: c_long,
328
- pub st_mtime: :: time_t,
329
- pub st_mtime_nsec: :: c_long,
330
- pub st_ctime: :: time_t,
331
- pub st_ctime_nsec: :: c_long,
332
- __reserved: [ :: c_long; 3 ] ,
333
- }
334
-
335
290
pub struct rlimit64 { // ToDo
336
291
pub rlim_cur: rlim64_t,
337
292
pub rlim_max: rlim64_t,
@@ -344,11 +299,6 @@ s! {
344
299
bits: [ u64 ; 16 ] ,
345
300
}
346
301
347
- pub struct timespec { // ToDo
348
- tv_sec: time_t, // seconds
349
- tv_nsec: :: c_ulong, // nanoseconds
350
- }
351
-
352
302
pub struct fsid_t { // ToDo
353
303
__val: [ :: c_int; 2 ] ,
354
304
}
0 commit comments