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+
14add_lldb_unittest(ProcessElfCoreTests
25 ThreadElfCoreTest.cpp
36
@@ -13,3 +16,11 @@ add_lldb_unittest(ProcessElfCoreTests
1316 LINK_COMPONENTS
1417 Support
1518 )
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 2424#include < sys/resource.h>
2525#include < unistd.h>
2626
27+ #ifndef HAVE_GETTID
28+ #include < sys/syscall.h>
29+ pid_t gettid () { return ((pid_t )syscall (SYS_gettid)); }
30+ #endif
31+
2732using namespace lldb_private ;
2833
2934namespace {
You can’t perform that action at this time.
0 commit comments