summaryrefslogtreecommitdiff
path: root/compiler-rt/include
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-02-15 02:43:02 +0000
committerKamil Rytarowski <n54@gmx.com>2018-02-15 02:43:02 +0000
commit10e9c02950a4b0a11d8c0d375d66b612c1597aaa (patch)
tree69e69b7ebd5a3b4ef11daa16d489c0a88f39f5bc /compiler-rt/include
parent2c43207875dffc569c98909f66f56ad21c97df89 (diff)
Add NetBSD syscall hooks skeleton in sanitizers
Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048
Diffstat (limited to 'compiler-rt/include')
-rw-r--r--compiler-rt/include/CMakeLists.txt1
-rw-r--r--compiler-rt/include/sanitizer/netbsd_syscall_hooks.h45
2 files changed, 46 insertions, 0 deletions
diff --git a/compiler-rt/include/CMakeLists.txt b/compiler-rt/include/CMakeLists.txt
index f7efb102ab6..c4b93b89a30 100644
--- a/compiler-rt/include/CMakeLists.txt
+++ b/compiler-rt/include/CMakeLists.txt
@@ -10,6 +10,7 @@ if (COMPILER_RT_BUILD_SANITIZERS)
sanitizer/linux_syscall_hooks.h
sanitizer/lsan_interface.h
sanitizer/msan_interface.h
+ sanitizer/netbsd_syscall_hooks.h
sanitizer/scudo_interface.h
sanitizer/tsan_interface.h
sanitizer/tsan_interface_atomic.h)
diff --git a/compiler-rt/include/sanitizer/netbsd_syscall_hooks.h b/compiler-rt/include/sanitizer/netbsd_syscall_hooks.h
new file mode 100644
index 00000000000..d0b54be533e
--- /dev/null
+++ b/compiler-rt/include/sanitizer/netbsd_syscall_hooks.h
@@ -0,0 +1,45 @@
+//===-- netbsd_syscall_hooks.h --------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of public sanitizer interface.
+//
+// System call handlers.
+//
+// Interface methods declared in this header implement pre- and post- syscall
+// actions for the active sanitizer.
+// Usage:
+// __sanitizer_syscall_pre_getfoo(...args...);
+// long long res = syscall(SYS_getfoo, ...args...);
+// __sanitizer_syscall_post_getfoo(res, ...args...);
+//
+// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!
+//
+// Generated with: generate_netbsd_syscalls.awk
+// Generated date: 2018-02-15
+// Generated from: syscalls.master,v 1.291 2018/01/06 16:41:23 kamil Exp
+//
+//===----------------------------------------------------------------------===//
+#ifndef SANITIZER_NETBSD_SYSCALL_HOOKS_H
+#define SANITIZER_NETBSD_SYSCALL_HOOKS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Private declarations. Do not call directly from user code. Use macros above.
+
+// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!
+
+#endif // SANITIZER_NETBSD_SYSCALL_HOOKS_H