[compiler-rt] 1dc8387 - tsan: fix syscall test on aarch64

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 00:00:57 PDT 2021


Author: Dmitry Vyukov
Date: 2021-05-12T09:00:51+02:00
New Revision: 1dc838717a294ed7bfd7d597d427886ce61df122

URL: https://github.com/llvm/llvm-project/commit/1dc838717a294ed7bfd7d597d427886ce61df122
DIFF: https://github.com/llvm/llvm-project/commit/1dc838717a294ed7bfd7d597d427886ce61df122.diff

LOG: tsan: fix syscall test on aarch64

Add missing includes and use SYS_pipe2 instead of SYS_pipe
as it's not present on some arches.

Differential Revision: https://reviews.llvm.org/D102311

Added: 
    

Modified: 
    compiler-rt/test/tsan/Linux/syscall.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/tsan/Linux/syscall.h b/compiler-rt/test/tsan/Linux/syscall.h
index ccbc0d4b3cbcc..2d0a854d12449 100644
--- a/compiler-rt/test/tsan/Linux/syscall.h
+++ b/compiler-rt/test/tsan/Linux/syscall.h
@@ -1,4 +1,6 @@
+#include <fcntl.h>
 #include <sanitizer/linux_syscall_hooks.h>
+#include <signal.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -16,7 +18,7 @@ int myfork() {
 
 int mypipe(int pipefd[2]) {
   __sanitizer_syscall_pre_pipe(pipefd);
-  int res = syscall(SYS_pipe, pipefd);
+  int res = syscall(SYS_pipe2, pipefd, 0);
   __sanitizer_syscall_post_pipe(res, pipefd);
   return res;
 }


        


More information about the llvm-commits mailing list