summaryrefslogtreecommitdiff
path: root/src/sync_file_range2.c
diff options
context:
space:
mode:
authorChih-Hsuan Yen <yan12125@gmail.com>2021-12-17 20:48:53 +0800
committerDmitry V. Levin <ldv@strace.io>2021-12-17 12:53:40 +0000
commit5c66559f9d84485839c6529065a96c3d16edf6d9 (patch)
treeec3606ab70849e09f8426ac2092190079aa1be24 /src/sync_file_range2.c
parent6fc38f0ab039df9dfab0c5d73c30566cc40f67a4 (diff)
downloadstrace-5c66559f9d84485839c6529065a96c3d16edf6d9.tar.gz
Fix building for older Android
With the following commands, $ ./bootstrap $ _pkg_arch=aarch64 $ export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" $ CC=$_pkg_arch-linux-android21-clang \ ./configure --prefix=/opt/android-libs/${_pkg_arch/_/-} \ --host=$_pkg_arch-linux-android \ --without-libunwind \ --enable-mpers=no \ --disable-gcc-Werror $ make Building fails with error diagnostics like this: In file included from sync_file_range.c:12: ./xlat/sync_file_range_flags.h:7:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE' static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1"); This is a build regression from bd87cc95120b3707a6fe55129451bb0453730a6d, where "#unconditional" is added given that <linux/fs.h> is bundled, but the latter is not explicitly #include'd. As a side note, SYNC_FILE_RANGE* symbols are not available with ANDROID_API__ < 26 [1]. [1] https://android.googlesource.com/platform/bionic/+/refs/tags/android-12.0.0_r15/libc/include/fcntl.h#98 * src/sync_file_range.c: Include <linux/fs.h>. * src/sync_file_range2.c: Likewise. Fixes: v5.15~76 "xlat: add #unconditional to sync_file_range_flags"
Diffstat (limited to 'src/sync_file_range2.c')
-rw-r--r--src/sync_file_range2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sync_file_range2.c b/src/sync_file_range2.c
index 30498211c..3abd254dc 100644
--- a/src/sync_file_range2.c
+++ b/src/sync_file_range2.c
@@ -9,6 +9,7 @@
#include "defs.h"
#include <fcntl.h>
+#include <linux/fs.h>
#include "xlat/sync_file_range_flags.h"
SYS_FUNC(sync_file_range2)