@@ -21,29 +21,31 @@ use libc::fstatat as fstatat64;
21
21
#[ cfg( any( all( target_os = "linux" , not( target_env = "musl" ) ) , target_os = "hurd" ) ) ]
22
22
use libc:: fstatat64;
23
23
#[ cfg( any(
24
+ target_os = "aix" ,
24
25
target_os = "android" ,
25
- target_os = "solaris " ,
26
+ target_os = "freebsd " ,
26
27
target_os = "fuchsia" ,
27
- target_os = "redox" ,
28
28
target_os = "illumos" ,
29
- target_os = "aix" ,
30
29
target_os = "nto" ,
30
+ target_os = "redox" ,
31
+ target_os = "solaris" ,
31
32
target_os = "vita" ,
32
33
all( target_os = "linux" , target_env = "musl" ) ,
33
34
) ) ]
34
35
use libc:: readdir as readdir64;
35
36
#[ cfg( not( any(
37
+ target_os = "aix" ,
36
38
target_os = "android" ,
37
- target_os = "linux" ,
38
- target_os = "solaris" ,
39
+ target_os = "freebsd" ,
40
+ target_os = "fuchsia" ,
41
+ target_os = "hurd" ,
39
42
target_os = "illumos" ,
40
43
target_os = "l4re" ,
41
- target_os = "fuchsia" ,
42
- target_os = "redox" ,
43
- target_os = "aix" ,
44
+ target_os = "linux" ,
44
45
target_os = "nto" ,
46
+ target_os = "redox" ,
47
+ target_os = "solaris" ,
45
48
target_os = "vita" ,
46
- target_os = "hurd" ,
47
49
) ) ) ]
48
50
use libc:: readdir_r as readdir64_r;
49
51
#[ cfg( any( all( target_os = "linux" , not( target_env = "musl" ) ) , target_os = "hurd" ) ) ]
@@ -271,16 +273,17 @@ unsafe impl Send for Dir {}
271
273
unsafe impl Sync for Dir { }
272
274
273
275
#[ cfg( any(
276
+ target_os = "aix" ,
274
277
target_os = "android" ,
275
- target_os = "linux" ,
276
- target_os = "solaris" ,
277
- target_os = "illumos" ,
278
+ target_os = "freebsd" ,
278
279
target_os = "fuchsia" ,
279
- target_os = "redox" ,
280
- target_os = "aix" ,
280
+ target_os = "hurd" ,
281
+ target_os = "illumos" ,
282
+ target_os = "linux" ,
281
283
target_os = "nto" ,
284
+ target_os = "redox" ,
285
+ target_os = "solaris" ,
282
286
target_os = "vita" ,
283
- target_os = "hurd" ,
284
287
) ) ]
285
288
pub struct DirEntry {
286
289
dir : Arc < InnerReadDir > ,
@@ -295,16 +298,17 @@ pub struct DirEntry {
295
298
// we're not using the immediate `d_name` on these targets. Keeping this as an
296
299
// `entry` field in `DirEntry` helps reduce the `cfg` boilerplate elsewhere.
297
300
#[ cfg( any(
301
+ target_os = "aix" ,
298
302
target_os = "android" ,
299
- target_os = "linux" ,
300
- target_os = "solaris" ,
301
- target_os = "illumos" ,
303
+ target_os = "freebsd" ,
302
304
target_os = "fuchsia" ,
303
- target_os = "redox" ,
304
- target_os = "aix" ,
305
+ target_os = "hurd" ,
306
+ target_os = "illumos" ,
307
+ target_os = "linux" ,
305
308
target_os = "nto" ,
309
+ target_os = "redox" ,
310
+ target_os = "solaris" ,
306
311
target_os = "vita" ,
307
- target_os = "hurd" ,
308
312
) ) ]
309
313
struct dirent64_min {
310
314
d_ino : u64 ,
@@ -319,16 +323,17 @@ struct dirent64_min {
319
323
}
320
324
321
325
#[ cfg( not( any(
326
+ target_os = "aix" ,
322
327
target_os = "android" ,
323
- target_os = "linux" ,
324
- target_os = "solaris" ,
325
- target_os = "illumos" ,
328
+ target_os = "freebsd" ,
326
329
target_os = "fuchsia" ,
327
- target_os = "redox" ,
328
- target_os = "aix" ,
330
+ target_os = "hurd" ,
331
+ target_os = "illumos" ,
332
+ target_os = "linux" ,
329
333
target_os = "nto" ,
334
+ target_os = "redox" ,
335
+ target_os = "solaris" ,
330
336
target_os = "vita" ,
331
- target_os = "hurd" ,
332
337
) ) ) ]
333
338
pub struct DirEntry {
334
339
dir : Arc < InnerReadDir > ,
@@ -698,16 +703,17 @@ impl Iterator for ReadDir {
698
703
type Item = io:: Result < DirEntry > ;
699
704
700
705
#[ cfg( any(
706
+ target_os = "aix" ,
701
707
target_os = "android" ,
702
- target_os = "linux" ,
703
- target_os = "solaris" ,
708
+ target_os = "freebsd" ,
704
709
target_os = "fuchsia" ,
705
- target_os = "redox " ,
710
+ target_os = "hurd " ,
706
711
target_os = "illumos" ,
707
- target_os = "aix " ,
712
+ target_os = "linux " ,
708
713
target_os = "nto" ,
714
+ target_os = "redox" ,
715
+ target_os = "solaris" ,
709
716
target_os = "vita" ,
710
- target_os = "hurd" ,
711
717
) ) ]
712
718
fn next ( & mut self ) -> Option < io:: Result < DirEntry > > {
713
719
use crate :: sys:: os:: { errno, set_errno} ;
@@ -768,6 +774,9 @@ impl Iterator for ReadDir {
768
774
// only access those bytes.
769
775
#[ cfg( not( target_os = "vita" ) ) ]
770
776
let entry = dirent64_min {
777
+ #[ cfg( target_os = "freebsd" ) ]
778
+ d_ino : ( * entry_ptr) . d_fileno ,
779
+ #[ cfg( not( target_os = "freebsd" ) ) ]
771
780
d_ino : ( * entry_ptr) . d_ino as u64 ,
772
781
#[ cfg( not( any(
773
782
target_os = "solaris" ,
@@ -791,16 +800,17 @@ impl Iterator for ReadDir {
791
800
}
792
801
793
802
#[ cfg( not( any(
803
+ target_os = "aix" ,
794
804
target_os = "android" ,
795
- target_os = "linux" ,
796
- target_os = "solaris" ,
805
+ target_os = "freebsd" ,
797
806
target_os = "fuchsia" ,
798
- target_os = "redox " ,
807
+ target_os = "hurd " ,
799
808
target_os = "illumos" ,
800
- target_os = "aix " ,
809
+ target_os = "linux " ,
801
810
target_os = "nto" ,
811
+ target_os = "redox" ,
812
+ target_os = "solaris" ,
802
813
target_os = "vita" ,
803
- target_os = "hurd" ,
804
814
) ) ) ]
805
815
fn next ( & mut self ) -> Option < io:: Result < DirEntry > > {
806
816
if self . end_of_stream {
@@ -970,36 +980,32 @@ impl DirEntry {
970
980
}
971
981
972
982
#[ cfg( any(
973
- target_os = "linux" ,
983
+ target_os = "aix" ,
984
+ target_os = "android" ,
974
985
target_os = "cygwin" ,
975
986
target_os = "emscripten" ,
976
- target_os = "android" ,
977
- target_os = "solaris" ,
978
- target_os = "illumos" ,
979
- target_os = "haiku" ,
980
- target_os = "l4re" ,
981
- target_os = "fuchsia" ,
982
- target_os = "redox" ,
983
- target_os = "vxworks" ,
984
987
target_os = "espidf" ,
988
+ target_os = "freebsd" ,
989
+ target_os = "fuchsia" ,
990
+ target_os = "haiku" ,
985
991
target_os = "horizon" ,
986
- target_os = "vita" ,
987
- target_os = "aix" ,
988
- target_os = "nto" ,
989
992
target_os = "hurd" ,
993
+ target_os = "illumos" ,
994
+ target_os = "l4re" ,
995
+ target_os = "linux" ,
996
+ target_os = "nto" ,
997
+ target_os = "redox" ,
990
998
target_os = "rtems" ,
999
+ target_os = "solaris" ,
1000
+ target_os = "vita" ,
1001
+ target_os = "vxworks" ,
991
1002
target_vendor = "apple" ,
992
1003
) ) ]
993
1004
pub fn ino ( & self ) -> u64 {
994
1005
self . entry . d_ino as u64
995
1006
}
996
1007
997
- #[ cfg( any(
998
- target_os = "freebsd" ,
999
- target_os = "openbsd" ,
1000
- target_os = "netbsd" ,
1001
- target_os = "dragonfly"
1002
- ) ) ]
1008
+ #[ cfg( any( target_os = "openbsd" , target_os = "netbsd" , target_os = "dragonfly" ) ) ]
1003
1009
pub fn ino ( & self ) -> u64 {
1004
1010
self . entry . d_fileno as u64
1005
1011
}
@@ -1014,7 +1020,6 @@ impl DirEntry {
1014
1020
#[ cfg( any(
1015
1021
target_os = "netbsd" ,
1016
1022
target_os = "openbsd" ,
1017
- target_os = "freebsd" ,
1018
1023
target_os = "dragonfly" ,
1019
1024
target_vendor = "apple" ,
1020
1025
) ) ]
@@ -1030,7 +1035,6 @@ impl DirEntry {
1030
1035
#[ cfg( not( any(
1031
1036
target_os = "netbsd" ,
1032
1037
target_os = "openbsd" ,
1033
- target_os = "freebsd" ,
1034
1038
target_os = "dragonfly" ,
1035
1039
target_vendor = "apple" ,
1036
1040
) ) ) ]
@@ -1040,6 +1044,7 @@ impl DirEntry {
1040
1044
1041
1045
#[ cfg( not( any(
1042
1046
target_os = "android" ,
1047
+ target_os = "freebsd" ,
1043
1048
target_os = "linux" ,
1044
1049
target_os = "solaris" ,
1045
1050
target_os = "illumos" ,
@@ -1055,6 +1060,7 @@ impl DirEntry {
1055
1060
}
1056
1061
#[ cfg( any(
1057
1062
target_os = "android" ,
1063
+ target_os = "freebsd" ,
1058
1064
target_os = "linux" ,
1059
1065
target_os = "solaris" ,
1060
1066
target_os = "illumos" ,
0 commit comments