We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e0fc15 commit 264d964Copy full SHA for 264d964
lldb/unittests/Process/elf-core/CMakeLists.txt
@@ -1,3 +1,14 @@
1
+include(CheckSymbolExists)
2
+include(CMakePushCheckState)
3
+
4
+cmake_push_check_state()
5
+set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
6
+check_symbol_exists(gettid "unistd.h" HAVE_GETTID)
7
+if(HAVE_GETTID)
8
+ add_compile_definitions(-DHAVE_GETTID)
9
+endif()
10
+cmake_pop_check_state()
11
12
add_lldb_unittest(ProcessElfCoreTests
13
ThreadElfCoreTest.cpp
14
lldb/unittests/Process/elf-core/ThreadElfCoreTest.cpp
@@ -23,6 +23,11 @@
23
#include <mutex>
24
#include <unistd.h>
25
26
+#ifndef HAVE_GETTID
27
+#include <sys/syscall.h>
28
+pid_t gettid() { return ((pid_t)syscall(SYS_gettid)); }
29
+#endif
30
31
using namespace lldb_private;
32
33
namespace {
0 commit comments