@@ -48,6 +48,7 @@ pub use types::common::posix88::*;
48
48
pub use types:: common:: posix01:: * ;
49
49
pub use types:: common:: posix08:: * ;
50
50
pub use types:: common:: bsd44:: * ;
51
+ pub use types:: os:: common:: posix01:: * ;
51
52
pub use types:: os:: arch:: c95:: * ;
52
53
pub use types:: os:: arch:: c99:: * ;
53
54
pub use types:: os:: arch:: posix88:: * ;
@@ -69,12 +70,13 @@ pub use funcs::c95::stdio::*;
69
70
pub use funcs:: c95:: stdlib:: * ;
70
71
pub use funcs:: c95:: string:: * ;
71
72
72
- pub use funcs:: posix88:: stat :: * ;
73
+ pub use funcs:: posix88:: stat_ :: * ;
73
74
pub use funcs:: posix88:: stdio:: * ;
74
75
pub use funcs:: posix88:: fcntl:: * ;
75
76
pub use funcs:: posix88:: dirent:: * ;
76
77
pub use funcs:: posix88:: unistd:: * ;
77
78
79
+ pub use funcs:: posix01:: stat_:: * ;
78
80
pub use funcs:: posix01:: unistd:: * ;
79
81
pub use funcs:: posix08:: unistd:: * ;
80
82
@@ -122,6 +124,8 @@ pub use open, creat;
122
124
pub use access, chdir, close, dup, dup2, execv, execve, execvp, getcwd,
123
125
getpid, isatty, lseek, pipe, read, rmdir, unlink, write;
124
126
127
+ pub use fstat, lstat, stat;
128
+
125
129
126
130
mod types {
127
131
@@ -158,6 +162,10 @@ mod types {
158
162
159
163
#[ cfg( target_os = "linux" ) ]
160
164
pub mod os {
165
+ pub mod common {
166
+ pub mod posix01 { }
167
+ }
168
+
161
169
#[ cfg( target_arch = "x86" ) ]
162
170
pub mod arch {
163
171
pub mod c95 {
@@ -195,7 +203,33 @@ mod types {
195
203
pub type mode_t = u32 ;
196
204
pub type ssize_t = i32 ;
197
205
}
198
- pub mod posix01 { }
206
+ pub mod posix01 {
207
+ pub type nlink_t = u32 ;
208
+ pub type blksize_t = i32 ;
209
+ pub type blkcnt_t = i32 ;
210
+ pub struct stat {
211
+ st_dev : dev_t ,
212
+ __pad1 : c_short ,
213
+ st_ino : ino_t ,
214
+ st_mode : mode_t ,
215
+ st_nlink : nlink_t ,
216
+ st_uid : uid_t ,
217
+ st_gid : gid_t ,
218
+ st_rdev : dev_t ,
219
+ __pad2 : c_short ,
220
+ st_size : off_t ,
221
+ st_blksize : blksize_t ,
222
+ st_blocks : blkcnt_t ,
223
+ st_atime : time_t ,
224
+ st_atime_nsec : c_long ,
225
+ st_mtime : time_t ,
226
+ st_mtime_nsec : c_long ,
227
+ st_ctime : time_t ,
228
+ st_ctime_nsec : c_long ,
229
+ __unused4 : c_long ,
230
+ __unused5 : c_long ,
231
+ }
232
+ }
199
233
pub mod posix08 { }
200
234
pub mod bsd44 { }
201
235
pub mod extra { }
@@ -239,6 +273,29 @@ mod types {
239
273
pub type ssize_t = i64 ;
240
274
}
241
275
pub mod posix01 {
276
+ pub type nlink_t = u64 ;
277
+ pub type blksize_t = i64 ;
278
+ pub type blkcnt_t = i64 ;
279
+ pub struct stat {
280
+ st_dev : dev_t ,
281
+ st_ino : ino_t ,
282
+ st_nlink : nlink_t ,
283
+ st_mode : mode_t ,
284
+ st_uid : uid_t ,
285
+ st_gid : gid_t ,
286
+ __pad0 : c_int ,
287
+ st_rdev : dev_t ,
288
+ st_size : off_t ,
289
+ st_blksize : blksize_t ,
290
+ st_blocks : blkcnt_t ,
291
+ st_atime : time_t ,
292
+ st_atime_nsec : c_long ,
293
+ st_mtime : time_t ,
294
+ st_mtime_nsec : c_long ,
295
+ st_ctime : time_t ,
296
+ st_ctime_nsec : c_long ,
297
+ __unused : [ c_long * 3 ] ,
298
+ }
242
299
}
243
300
pub mod posix08 {
244
301
}
@@ -251,6 +308,10 @@ mod types {
251
308
252
309
#[ cfg( target_os = "freebsd" ) ]
253
310
pub mod os {
311
+ pub mod common {
312
+ pub mod posix01 { }
313
+ }
314
+
254
315
#[ cfg( target_arch = "x86_64" ) ]
255
316
pub mod arch {
256
317
pub mod c95 {
@@ -289,6 +350,34 @@ mod types {
289
350
pub type ssize_t = i64 ;
290
351
}
291
352
pub mod posix01 {
353
+ pub type nlink_t = u16 ;
354
+ pub type blksize_t = i64 ;
355
+ pub type blkcnt_t = i64 ;
356
+ pub type fflags_t = u32 ;
357
+ pub struct stat {
358
+ st_dev : dev_t ,
359
+ st_ino : ino_t ,
360
+ st_mode : mode_t ,
361
+ st_nlink : nlink_t ,
362
+ st_uid : uid_t ,
363
+ st_gid : gid_t ,
364
+ st_rdev : dev_t ,
365
+ st_atime : time_t ,
366
+ st_atime_nsec : c_long ,
367
+ st_mtime : time_t ,
368
+ st_mtime_nsec : c_long ,
369
+ st_ctime : time_t ,
370
+ st_ctime_nsec : c_long ,
371
+ st_size : off_t ,
372
+ st_blocks : blkcnt_t ,
373
+ st_blksize : blksize_t ,
374
+ st_flags : fflags_t ,
375
+ st_gen : uint32_t ,
376
+ st_lspare : int32_t ,
377
+ st_birthtime : time_t ,
378
+ st_birthtime_nsec : c_long ,
379
+ __unused : [ uint8_t * 2 ] ,
380
+ }
292
381
}
293
382
pub mod posix08 {
294
383
}
@@ -301,6 +390,24 @@ mod types {
301
390
302
391
#[ cfg( target_os = "win32" ) ]
303
392
pub mod os {
393
+ pub mod common {
394
+ pub mod posix01 {
395
+ pub struct stat {
396
+ st_dev : dev_t ,
397
+ st_ino : ino_t ,
398
+ st_mode : mode_t ,
399
+ st_nlink : c_short ,
400
+ st_uid : c_short ,
401
+ st_gid : c_short ,
402
+ st_rdev : dev_t ,
403
+ st_size : int64_t ,
404
+ st_atime : time64_t ,
405
+ st_mtime : time64_t ,
406
+ st_c_time : time64_t ,
407
+ }
408
+ }
409
+ }
410
+
304
411
#[ cfg( target_arch = "x86" ) ]
305
412
pub mod arch {
306
413
pub mod c95 {
@@ -378,6 +485,38 @@ mod types {
378
485
379
486
#[ cfg( target_os = "macos" ) ]
380
487
pub mod os {
488
+ pub mod common {
489
+ pub mod posix01 {
490
+ pub type nlink_t = u16 ;
491
+ pub type blksize_t = i64 ;
492
+ pub type blkcnt_t = i32 ;
493
+ pub struct stat {
494
+ st_dev : dev_t ,
495
+ st_mode : mode_t ,
496
+ st_nlink : nlink_t ,
497
+ st_ino : ino_t ,
498
+ st_uid : uid_t ,
499
+ st_gid : gid_t ,
500
+ st_rdev : dev_t ,
501
+ st_atime : time_t ,
502
+ st_atime_nsec : c_long ,
503
+ st_mtime : time_t ,
504
+ st_mtime_nsec : c_long ,
505
+ st_ctime : time_t ,
506
+ st_ctime_nsec : c_long ,
507
+ st_birthtime : time_t ,
508
+ st_birthtime_nsec : c_long ,
509
+ st_size : off_t ,
510
+ st_blocks : blkcnt_t ,
511
+ st_blksize : blksize_t ,
512
+ st_flags : uint32_t ,
513
+ st_gen : uint32_t ,
514
+ st_lspare : int32_t ,
515
+ st_qspare : [ int64_t * 2 ] ,
516
+ }
517
+ }
518
+ }
519
+
381
520
#[ cfg( target_arch = "x86" ) ]
382
521
pub mod arch {
383
522
pub mod c95 {
@@ -880,7 +1019,7 @@ pub mod funcs {
880
1019
pub mod posix88 {
881
1020
#[ nolink]
882
1021
#[ abi = "cdecl" ]
883
- pub extern mod stat {
1022
+ pub extern mod stat_ {
884
1023
#[ link_name = "_chmod" ]
885
1024
fn chmod ( path : * c_char , mode : c_int ) -> c_int ;
886
1025
@@ -990,11 +1129,28 @@ pub mod funcs {
990
1129
pub mod posix88 {
991
1130
#[ nolink]
992
1131
#[ abi = "cdecl" ]
993
- pub extern mod stat {
1132
+ pub extern mod stat_ {
994
1133
fn chmod ( path : * c_char , mode : mode_t ) -> c_int ;
995
1134
fn fchmod ( fd : c_int , mode : mode_t ) -> c_int ;
1135
+
1136
+ #[ cfg( target_os = "linux" ) ]
1137
+ #[ cfg( target_os = "freebsd" ) ]
1138
+ fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
1139
+
1140
+ #[ cfg( target_os = "macos" ) ]
1141
+ #[ link_name = "fstat64" ]
1142
+ fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
1143
+
996
1144
fn mkdir ( path : * c_char , mode : mode_t ) -> c_int ;
997
1145
fn mkfifo ( path : * c_char , mode : mode_t ) -> c_int ;
1146
+
1147
+ #[ cfg( target_os = "linux" ) ]
1148
+ #[ cfg( target_os = "freebsd" ) ]
1149
+ fn stat ( path : * c_char , buf : * mut stat ) -> c_int ;
1150
+
1151
+ #[ cfg( target_os = "macos" ) ]
1152
+ #[ link_name = "stat64" ]
1153
+ fn stat ( path : * c_char , buf : * mut stat ) -> c_int ;
998
1154
}
999
1155
1000
1156
#[ nolink]
@@ -1079,6 +1235,18 @@ pub mod funcs {
1079
1235
#[ cfg( target_os = "macos" ) ]
1080
1236
#[ cfg( target_os = "freebsd" ) ]
1081
1237
pub mod posix01 {
1238
+ #[ nolink]
1239
+ #[ abi = "cdecl" ]
1240
+ pub extern mod stat_ {
1241
+ #[ cfg( target_os = "linux" ) ]
1242
+ #[ cfg( target_os = "freebsd" ) ]
1243
+ fn lstat ( path : * c_char , buf : * mut stat ) -> c_int ;
1244
+
1245
+ #[ cfg( target_os = "macos" ) ]
1246
+ #[ link_name = "lstat64" ]
1247
+ fn lstat ( path : * c_char , buf : * mut stat ) -> c_int ;
1248
+ }
1249
+
1082
1250
#[ nolink]
1083
1251
#[ abi = "cdecl" ]
1084
1252
pub extern mod unistd {
@@ -1106,6 +1274,10 @@ pub mod funcs {
1106
1274
1107
1275
#[ cfg( target_os = "win32" ) ]
1108
1276
pub mod posix01 {
1277
+ #[ nolink]
1278
+ pub extern mod stat_ {
1279
+ }
1280
+
1109
1281
#[ nolink]
1110
1282
pub extern mod unistd {
1111
1283
}
0 commit comments