Merge "Add missing includes."
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);