Skip to content

Commit 106b57a

Browse files
committed
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.
2 parents 1689b94 + ca8f072 commit 106b57a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,9 @@ fn test_android(target: &str) {
18191819
// Added in API level 28, but some tests use level 24.
18201820
"getrandom" => true,
18211821

1822+
// Added in API level 28, but some tests use level 24.
1823+
"syncfs" => true,
1824+
18221825
_ => false,
18231826
}
18241827
});

libc-test/semver/android.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,6 +3530,7 @@ swapoff
35303530
swapon
35313531
symlink
35323532
symlinkat
3533+
syncfs
35333534
syscall
35343535
sysconf
35353536
sysinfo

src/unix/linux_like/android/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,6 +3510,8 @@ extern "C" {
35103510
longopts: *const option,
35113511
longindex: *mut ::c_int,
35123512
) -> ::c_int;
3513+
3514+
pub fn syncfs(fd: ::c_int) -> ::c_int;
35133515
}
35143516

35153517
cfg_if! {

0 commit comments

Comments
 (0)