[PATCH] D66867: [XRay] Fixing one test case for FreeBSD
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 07:19:14 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370209: [XRay] Fixing one test case for FreeBSD (authored by devnexen, committed by ).
Herald added a subscriber: delcypher.
Changed prior to commit:
https://reviews.llvm.org/D66867?vs=217597&id=217643#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66867/new/
https://reviews.llvm.org/D66867
Files:
compiler-rt/trunk/test/xray/TestCases/Posix/fork_basic_logging.cpp
Index: compiler-rt/trunk/test/xray/TestCases/Posix/fork_basic_logging.cpp
===================================================================
--- compiler-rt/trunk/test/xray/TestCases/Posix/fork_basic_logging.cpp
+++ compiler-rt/trunk/test/xray/TestCases/Posix/fork_basic_logging.cpp
@@ -18,14 +18,24 @@
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
+#if defined(__linux__)
#include <sys/syscall.h>
+#elif defined(__FreeBSD__)
+#include <sys/thr.h>
+#endif
//modified from sanitizer
static uintptr_t syscall_gettid() {
uint64_t retval;
+#ifdef __linux__
asm volatile("syscall" : "=a"(retval) : "a"(__NR_gettid) : "rcx", "r11",
"memory", "cc");
+#else
+ long t;
+ thr_self(&t);
+ retval = static_cast<uint64_t>(t);
+#endif
return retval;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66867.217643.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190828/5c8e7d78/attachment.bin>
More information about the llvm-commits
mailing list