[safestack] Remove unsupported platforms

llvm-svn: 351716
This commit is contained in:
Vitaly Buka 2019-01-21 02:21:59 +00:00
parent 7ef159dda5
commit 2b3d8b3286
1 changed files with 6 additions and 12 deletions

View File

@ -20,6 +20,10 @@
#include <sys/types.h>
#include <unistd.h>
#if !(SANITIZER_NETBSD || SANITIZER_FREEBSD || SANITIZER_LINUX)
#error "Support for your platform has not been implemented"
#endif
#if SANITIZER_NETBSD
#include <lwp.h>
#endif
@ -39,10 +43,6 @@ inline ThreadId GetTid() {
long Tid;
thr_self(&Tid);
return Tid;
#elif SANITIZER_OPENBSD
return syscall(SYS_getthrid);
#elif SANITIZER_SOLARIS
return thr_self();
#else
return syscall(SYS_gettid);
#endif
@ -52,16 +52,10 @@ inline int TgKill(pid_t pid, ThreadId tid, int sig) {
#if SANITIZER_NETBSD
(void)pid;
return _lwp_kill(tid, sig);
#elif SANITIZER_LINUX
return syscall(SYS_tgkill, pid, tid, sig);
#elif SANITIZER_FREEBSD
return syscall(SYS_thr_kill2, pid, tid, sig);
#elif SANITIZER_OPENBSD
(void)pid;
return syscall(SYSCALL(thrkill), tid, sig, nullptr);
#elif SANITIZER_SOLARIS
(void)pid;
return thr_kill(tid, sig);
#else
return syscall(SYS_tgkill, pid, tid, sig);
#endif
}