Merge "Allow read-only system properties to have arbitrary lengths"
diff --git a/libc/bionic/android_set_abort_message.cpp b/libc/bionic/android_set_abort_message.cpp
index 2a11613..8c80c5a 100644
--- a/libc/bionic/android_set_abort_message.cpp
+++ b/libc/bionic/android_set_abort_message.cpp
@@ -29,6 +29,7 @@
 #include <android/set_abort_message.h>
 
 #include <pthread.h>
+#include <string.h>
 #include <sys/mman.h>
 
 #include "private/ScopedPthreadMutexLocker.h"
diff --git a/libc/bionic/bionic_arc4random.cpp b/libc/bionic/bionic_arc4random.cpp
index a339900..391eb0c 100644
--- a/libc/bionic/bionic_arc4random.cpp
+++ b/libc/bionic/bionic_arc4random.cpp
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <stdatomic.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/auxv.h>
 #include <unistd.h>
 
diff --git a/libc/bionic/iconv.cpp b/libc/bionic/iconv.cpp
index b0372a1..015d70f 100644
--- a/libc/bionic/iconv.cpp
+++ b/libc/bionic/iconv.cpp
@@ -32,6 +32,7 @@
 #include <endian.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
 #include <uchar.h>
 
 #include "private/bionic_mbstate.h"
diff --git a/libc/bionic/icu.cpp b/libc/bionic/icu.cpp
index 944a3f8..78e551b 100644
--- a/libc/bionic/icu.cpp
+++ b/libc/bionic/icu.cpp
@@ -32,6 +32,7 @@
 #include <dlfcn.h>
 #include <pthread.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <async_safe/log.h>
 
diff --git a/libc/bionic/wcstod.cpp b/libc/bionic/wcstod.cpp
index 41df854..41a94fb 100644
--- a/libc/bionic/wcstod.cpp
+++ b/libc/bionic/wcstod.cpp
@@ -31,6 +31,7 @@
 #include <wchar.h>
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "local.h"
 
diff --git a/libc/tzcode/bionic.cpp b/libc/tzcode/bionic.cpp
index b486174..9b59183 100644
--- a/libc/tzcode/bionic.cpp
+++ b/libc/tzcode/bionic.cpp
@@ -27,6 +27,7 @@
  */
 
 #include <arpa/inet.h> // For ntohl(3).
+#include <errno.h>
 #include <fcntl.h>
 #include <stdint.h>
 #include <stdlib.h>
diff --git a/libc/upstream-openbsd/android/include/arc4random.h b/libc/upstream-openbsd/android/include/arc4random.h
index 4c4be0e..afa8d14 100644
--- a/libc/upstream-openbsd/android/include/arc4random.h
+++ b/libc/upstream-openbsd/android/include/arc4random.h
@@ -22,10 +22,10 @@
  * Stub functions for portability.
  */
 
-#include <sys/mman.h>
-
+#include <errno.h>
 #include <pthread.h>
 #include <signal.h>
+#include <sys/mman.h>
 
 #include <async_safe/log.h>
 
diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h
index 9c16828..7fc6cbf 100644
--- a/linker/linker_allocator.h
+++ b/linker/linker_allocator.h
@@ -29,6 +29,7 @@
 #ifndef __LINKER_ALLOCATOR_H
 #define __LINKER_ALLOCATOR_H
 
+#include <errno.h>
 #include <stdlib.h>
 #include <sys/cdefs.h>
 #include <sys/mman.h>
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 66ea0f9..adc5ee4 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -21,6 +21,9 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>
+#if __has_include(<sys/auxv.h>)
+#include <sys/auxv.h>
+#endif
 
 #include <string>
 #include <thread>
@@ -246,6 +249,12 @@
 }
 
 TEST(dlfcn, dlopen_vdso) {
+#if __has_include(<sys/auxv.h>)
+  if (getauxval(AT_SYSINFO_EHDR) == 0) {
+    GTEST_LOG_(INFO) << "getauxval(AT_SYSINFO_EHDR) == 0, skipping this test.";
+    return;
+  }
+#endif
   void* handle = dlopen("linux-vdso.so.1", RTLD_NOW);
   ASSERT_TRUE(handle != nullptr) << dlerror();
   dlclose(handle);
diff --git a/tests/fcntl_test.cpp b/tests/fcntl_test.cpp
index 7e78830..cb00c3a 100644
--- a/tests/fcntl_test.cpp
+++ b/tests/fcntl_test.cpp
@@ -207,7 +207,7 @@
 }
 
 TEST(fcntl, tee) {
-  char expected[256];
+  char expected[BUFSIZ];
   FILE* expected_fp = fopen("/proc/version", "r");
   ASSERT_TRUE(expected_fp != NULL);
   ASSERT_TRUE(fgets(expected, sizeof(expected), expected_fp) != NULL);