File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
lldb/unittests/Process/elf-core Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ include (CheckSymbolExists )
2
+ include (CMakePushCheckState )
3
+
1
4
add_lldb_unittest (ProcessElfCoreTests
2
5
ThreadElfCoreTest.cpp
3
6
@@ -13,3 +16,11 @@ add_lldb_unittest(ProcessElfCoreTests
13
16
LINK_COMPONENTS
14
17
Support
15
18
)
19
+
20
+ cmake_push_check_state ()
21
+ set (CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE )
22
+ check_symbol_exists (gettid "unistd.h" HAVE_GETTID )
23
+ if (HAVE_GETTID )
24
+ target_compile_definitions (ProcessElfCoreTests PRIVATE HAVE_GETTID )
25
+ endif ()
26
+ cmake_pop_check_state ()
Original file line number Diff line number Diff line change 24
24
#include < sys/resource.h>
25
25
#include < unistd.h>
26
26
27
+ #ifndef HAVE_GETTID
28
+ #include < sys/syscall.h>
29
+ pid_t gettid () { return ((pid_t )syscall (SYS_gettid)); }
30
+ #endif
31
+
27
32
using namespace lldb_private ;
28
33
29
34
namespace {
You can’t perform that action at this time.
0 commit comments