@@ -17,6 +17,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
17
17
all( target_os = "linux" , target_env = "gnu" ) ,
18
18
target_os = "macos" ,
19
19
target_os = "ios" ,
20
+ target_os = "watchos" ,
20
21
) ) ]
21
22
use crate :: sys:: weak:: syscall;
22
23
#[ cfg( target_os = "macos" ) ]
@@ -27,6 +28,7 @@ use libc::{c_int, mode_t};
27
28
#[ cfg( any(
28
29
target_os = "macos" ,
29
30
target_os = "ios" ,
31
+ target_os = "watchos" ,
30
32
all( target_os = "linux" , target_env = "gnu" )
31
33
) ) ]
32
34
use libc:: c_char;
@@ -443,7 +445,8 @@ impl FileAttr {
443
445
target_os = "freebsd" ,
444
446
target_os = "openbsd" ,
445
447
target_os = "macos" ,
446
- target_os = "ios"
448
+ target_os = "ios" ,
449
+ target_os = "watchos" ,
447
450
) ) ]
448
451
pub fn created ( & self ) -> io:: Result < SystemTime > {
449
452
Ok ( SystemTime :: new ( self . stat . st_birthtime as i64 , self . stat . st_birthtime_nsec as i64 ) )
@@ -453,7 +456,8 @@ impl FileAttr {
453
456
target_os = "freebsd" ,
454
457
target_os = "openbsd" ,
455
458
target_os = "macos" ,
456
- target_os = "ios"
459
+ target_os = "ios" ,
460
+ target_os = "watchos" ,
457
461
) ) ) ]
458
462
pub fn created ( & self ) -> io:: Result < SystemTime > {
459
463
cfg_has_statx ! {
@@ -707,6 +711,7 @@ impl DirEntry {
707
711
#[ cfg( any(
708
712
target_os = "macos" ,
709
713
target_os = "ios" ,
714
+ target_os = "watchos" ,
710
715
target_os = "linux" ,
711
716
target_os = "emscripten" ,
712
717
target_os = "android" ,
@@ -737,6 +742,7 @@ impl DirEntry {
737
742
#[ cfg( any(
738
743
target_os = "macos" ,
739
744
target_os = "ios" ,
745
+ target_os = "watchos" ,
740
746
target_os = "netbsd" ,
741
747
target_os = "openbsd" ,
742
748
target_os = "freebsd" ,
@@ -754,6 +760,7 @@ impl DirEntry {
754
760
#[ cfg( not( any(
755
761
target_os = "macos" ,
756
762
target_os = "ios" ,
763
+ target_os = "watchos" ,
757
764
target_os = "netbsd" ,
758
765
target_os = "openbsd" ,
759
766
target_os = "freebsd" ,
@@ -911,11 +918,11 @@ impl File {
911
918
cvt_r ( || unsafe { os_fsync ( self . as_raw_fd ( ) ) } ) ?;
912
919
return Ok ( ( ) ) ;
913
920
914
- #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
921
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "watchos" ) ) ]
915
922
unsafe fn os_fsync ( fd : c_int ) -> c_int {
916
923
libc:: fcntl ( fd, libc:: F_FULLFSYNC )
917
924
}
918
- #[ cfg( not( any( target_os = "macos" , target_os = "ios" ) ) ) ]
925
+ #[ cfg( not( any( target_os = "macos" , target_os = "ios" , target_os = "watchos" ) ) ) ]
919
926
unsafe fn os_fsync ( fd : c_int ) -> c_int {
920
927
libc:: fsync ( fd)
921
928
}
@@ -925,7 +932,7 @@ impl File {
925
932
cvt_r ( || unsafe { os_datasync ( self . as_raw_fd ( ) ) } ) ?;
926
933
return Ok ( ( ) ) ;
927
934
928
- #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
935
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "watchos" ) ) ]
929
936
unsafe fn os_datasync ( fd : c_int ) -> c_int {
930
937
libc:: fcntl ( fd, libc:: F_FULLFSYNC )
931
938
}
@@ -946,7 +953,8 @@ impl File {
946
953
target_os = "linux" ,
947
954
target_os = "macos" ,
948
955
target_os = "netbsd" ,
949
- target_os = "openbsd"
956
+ target_os = "openbsd" ,
957
+ target_os = "watchos" ,
950
958
) ) ) ]
951
959
unsafe fn os_datasync ( fd : c_int ) -> c_int {
952
960
libc:: fsync ( fd)
@@ -1396,7 +1404,8 @@ fn open_to_and_set_permissions(
1396
1404
target_os = "linux" ,
1397
1405
target_os = "android" ,
1398
1406
target_os = "macos" ,
1399
- target_os = "ios"
1407
+ target_os = "ios" ,
1408
+ target_os = "watchos" ,
1400
1409
) ) ) ]
1401
1410
pub fn copy ( from : & Path , to : & Path ) -> io:: Result < u64 > {
1402
1411
let ( mut reader, reader_metadata) = open_from ( from) ?;
@@ -1423,7 +1432,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
1423
1432
}
1424
1433
}
1425
1434
1426
- #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
1435
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , target_os = "watchos" ) ) ]
1427
1436
pub fn copy ( from : & Path , to : & Path ) -> io:: Result < u64 > {
1428
1437
use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
1429
1438
0 commit comments