Define gettid symbol when testing on glibc < 2.30
Bug: 289414897
Test: it builds
Change-Id: Ic44514953f34096e8a681ef2587439953096ba53
diff --git a/tests/utils.cpp b/tests/utils.cpp
index 92ab145..948d0ec 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -28,6 +28,7 @@
#include "utils.h"
+#include <syscall.h>
#include <string>
#include <android-base/properties.h>
@@ -63,3 +64,9 @@
(android::base::GetBoolProperty("ro.debuggable", false) &&
android::base::GetBoolProperty("debug.force_low_ram", false));
}
+
+#if defined(__GLIBC__) && __GLIBC_MINOR__ < 30
+pid_t gettid() {
+ return syscall(__NR_gettid);
+}
+#endif