forked from OSchip/llvm-project
[test] [linux] define PR_SET_PTRACER constants if the system does not provide them
Android API <= 16 header do not have these symbols defined, but the kernel does support the relevant calls. And in general, since these calls are on a best-effort basis, it won't hurt even if we try to run in on a really ancient kernel. llvm-svn: 275393
This commit is contained in:
parent
6cf195b6d5
commit
fa3d652d26
|
@ -26,7 +26,14 @@
|
|||
#if defined(__linux__)
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
|
||||
// Android API <= 16 does not have these defined.
|
||||
#ifndef PR_SET_PTRACER
|
||||
#define PR_SET_PTRACER 0x59616d61
|
||||
#endif
|
||||
#ifndef PR_SET_PTRACER_ANY
|
||||
#define PR_SET_PTRACER_ANY ((unsigned long)-1)
|
||||
#endif
|
||||
|
||||
// For now we execute on best effort basis. If this fails for some reason, so be it.
|
||||
#define lldb_enable_attach() \
|
||||
do \
|
||||
|
@ -35,8 +42,6 @@
|
|||
(void)prctl_result; \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#else // not linux
|
||||
|
||||
#define lldb_enable_attach()
|
||||
|
|
Loading…
Reference in New Issue