diff options
author | bors <bors@rust-lang.org> | 2023-01-31 08:19:15 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-01-31 08:19:15 +0000 |
commit | 106b57a796145c42f9a385a2a8cf764abbc66624 (patch) | |
tree | f59f6235bd1da702de96854e0ea0924d5c8035ad | |
parent | 1689b942c3442bab5c3468d3323c3d817d6470a2 (diff) | |
parent | ca8f0726644d786a9addfb241af4a8a9af3f35d5 (diff) | |
download | rust-libc-106b57a796145c42f9a385a2a8cf764abbc66624.tar.gz |
Auto merge of #3060 - shikhapanwar:sycfs_for_android, r=JohnTitor
ANDROID: Add syncfs API in liblibc
This is required to sync everything in a single filesystem. Other solutions like sync() flushes all filesystems which is unnecessary, it is also impractical to call fsync on all files of the filesystem.
-rw-r--r-- | libc-test/build.rs | 3 | ||||
-rw-r--r-- | libc-test/semver/android.txt | 1 | ||||
-rw-r--r-- | src/unix/linux_like/android/mod.rs | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 24dc7f8c3d..3ae740faf3 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1819,6 +1819,9 @@ fn test_android(target: &str) { // Added in API level 28, but some tests use level 24. "getrandom" => true, + // Added in API level 28, but some tests use level 24. + "syncfs" => true, + _ => false, } }); diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index a2a6c69713..72f90c8a3c 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -3530,6 +3530,7 @@ swapoff swapon symlink symlinkat +syncfs syscall sysconf sysinfo diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 3337445496..2bc748ac4c 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3510,6 +3510,8 @@ extern "C" { longopts: *const option, longindex: *mut ::c_int, ) -> ::c_int; + + pub fn syncfs(fd: ::c_int) -> ::c_int; } cfg_if! { |