Skip to content

Commit

Permalink
enable unistd::{sync, syncfs} on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
tertsdiepraam committed Jan 17, 2024
1 parent 338d2b3 commit c91798d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ pub fn chroot<P: ?Sized + NixPath>(path: &P) -> Result<()> {
/// Commit filesystem caches to disk
///
/// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html)
#[cfg(any(freebsdlike, target_os = "linux", netbsdlike))]
#[cfg(any(freebsdlike, linux_android, netbsdlike))]
pub fn sync() {
unsafe { libc::sync() };
}
Expand All @@ -1387,7 +1387,7 @@ pub fn sync() {
/// descriptor `fd` to disk
///
/// See also [syncfs(2)](https://man7.org/linux/man-pages/man2/sync.2.html)
#[cfg(target_os = "linux")]
#[cfg(linux_android)]
pub fn syncfs(fd: RawFd) -> Result<()> {
let res = unsafe { libc::syncfs(fd) };

Expand Down

0 comments on commit c91798d

Please sign in to comment.