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 0dfa0ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/2296.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable unistd::{sync, syncfs} for Android
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 0dfa0ae

Please sign in to comment.