From da3c4301f7276025ad4f34fde29b6f88071111ca Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Thu, 23 Jul 2020 14:41:06 +0100 Subject: [PATCH 1/2] Android: Add preadv and friends. From sys/uio.h. Note that preadv64/pwritev64 are already included in src/unix/linux_like/mod.rs. --- libc-test/build.rs | 2 ++ src/unix/linux_like/android/mod.rs | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index efc9840a5e816..aa1a77b8987f8 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1595,7 +1595,9 @@ fn test_android(target: &str) { // FIXME: Somehow we cannot find these fns on aarch64. // https://github.com/rust-lang/libc/issues/1765 "lockf" + | "preadv" | "preadv64" + | "pwritev" | "pwritev64" | "openpty" | "forkpty" diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index e5a9a511c4c08..8c0dbf55d5f4b 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -2513,6 +2513,34 @@ extern "C" { new_value: *const itimerspec, old_value: *mut itimerspec, ) -> ::c_int; + pub fn preadv( + fd: ::c_int, + iov: *const ::iovec, + count: ::c_int, + offset: ::off_t, + ) -> ::ssize_t; + pub fn pwritev( + fd: ::c_int, + iov: *const ::iovec, + count: ::c_int, + offset: ::off_t, + ) -> ::ssize_t; + pub fn process_vm_readv( + pid: ::pid_t, + local_iov: *const ::iovec, + local_iov_count: ::c_ulong, + remote_iov: *const ::iovec, + remote_iov_count: ::c_ulong, + flags: ::c_ulong, + ) -> ::ssize_t; + pub fn process_vm_writev( + pid: ::pid_t, + local_iov: *const ::iovec, + local_iov_count: ::c_ulong, + remote_iov: *const ::iovec, + remote_iov_count: ::c_ulong, + flags: ::c_ulong, + ) -> ::ssize_t; pub fn syscall(num: ::c_long, ...) -> ::c_long; pub fn sched_getaffinity( pid: ::pid_t, From b8f387c9452941af8e136432a7f92ca91c4eb717 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Fri, 16 Oct 2020 18:06:24 +0100 Subject: [PATCH 2/2] Try using API 28 for all Android architectures. --- ci/android-install-ndk.sh | 6 +++--- libc-test/build.rs | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ci/android-install-ndk.sh b/ci/android-install-ndk.sh index e37a5542c38a4..b76422afa7bcd 100644 --- a/ci/android-install-ndk.sh +++ b/ci/android-install-ndk.sh @@ -9,15 +9,15 @@ unzip -q ${NDK}-linux-x86_64.zip case "$1" in arm) arch=arm - api=24 + api=28 ;; armv7) arch=arm - api=24 + api=28 ;; aarch64) arch=arm64 - api=24 + api=28 ;; i686) arch=x86 diff --git a/libc-test/build.rs b/libc-test/build.rs index aa1a77b8987f8..efc9840a5e816 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1595,9 +1595,7 @@ fn test_android(target: &str) { // FIXME: Somehow we cannot find these fns on aarch64. // https://github.com/rust-lang/libc/issues/1765 "lockf" - | "preadv" | "preadv64" - | "pwritev" | "pwritev64" | "openpty" | "forkpty"