Skip to content

Commit ca8f072

Browse files
author
Shikha Panwar
committed
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. This patch also excludes syncfs for arm from CI.
1 parent d1edf0c commit ca8f072

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
@@ -1806,6 +1806,9 @@ fn test_android(target: &str) {
18061806
// Added in API level 28, but some tests use level 24.
18071807
"getrandom" => true,
18081808

1809+
// Added in API level 28, but some tests use level 24.
1810+
"syncfs" => true,
1811+
18091812
_ => false,
18101813
}
18111814
});

libc-test/semver/android.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,6 +3517,7 @@ swapoff
35173517
swapon
35183518
symlink
35193519
symlinkat
3520+
syncfs
35203521
syscall
35213522
sysconf
35223523
sysinfo

src/unix/linux_like/android/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,8 @@ extern "C" {
35063506
longopts: *const option,
35073507
longindex: *mut ::c_int,
35083508
) -> ::c_int;
3509+
3510+
pub fn syncfs(fd: ::c_int) -> ::c_int;
35093511
}
35103512

35113513
cfg_if! {

0 commit comments

Comments
 (0)