File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change
1
+ Enable unistd::{sync, syncfs} for Android
Original file line number Diff line number Diff line change @@ -1378,7 +1378,7 @@ pub fn chroot<P: ?Sized + NixPath>(path: &P) -> Result<()> {
1378
1378
/// Commit filesystem caches to disk
1379
1379
///
1380
1380
/// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html)
1381
- #[ cfg( any( freebsdlike, target_os = "linux" , netbsdlike) ) ]
1381
+ #[ cfg( any( freebsdlike, linux_android , netbsdlike) ) ]
1382
1382
pub fn sync( ) {
1383
1383
unsafe { libc:: sync( ) } ;
1384
1384
}
@@ -1387,7 +1387,7 @@ pub fn sync() {
1387
1387
/// descriptor `fd` to disk
1388
1388
///
1389
1389
/// See also [syncfs(2)](https://man7.org/linux/man-pages/man2/sync.2.html)
1390
- #[ cfg( target_os = "linux" ) ]
1390
+ #[ cfg( linux_android ) ]
1391
1391
pub fn syncfs( fd: RawFd ) -> Result <( ) > {
1392
1392
let res = unsafe { libc:: syncfs( fd) } ;
1393
1393
You can’t perform that action at this time.
0 commit comments