summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-09-06 14:20:01 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-09-06 14:20:01 +0000
commit639df402c4925acd3ea7bebff729a535e3f79964 (patch)
treeecaf591438283a537b9883966a10705866d4772c /lib/sanitizer_common/sanitizer_platform_limits_linux.cc
parent0b2c3a79bbcba15bb973f8199bbd7052b43f548c (diff)
[sanitizer] A bunch of linux system call handlers.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_platform_limits_linux.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_platform_limits_linux.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_linux.cc b/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
new file mode 100644
index 000000000..a957cbe3e
--- /dev/null
+++ b/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
@@ -0,0 +1,47 @@
+//===-- sanitizer_platform_limits_linux.cc --------------------------------===//
+//
+// 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 Sanitizer common code.
+//
+// Sizes and layouts of linux kernel data structures.
+//===----------------------------------------------------------------------===//
+
+// This is a separate compilation unit for linux headers that conflict with
+// userspace headers.
+// Most "normal" includes go in sanitizer_platform_limits_posix.cc
+
+#include "sanitizer_platform.h"
+#if SANITIZER_LINUX
+
+// This header seems to contain the definitions of _kernel_ stat* structs.
+#include <asm/stat.h>
+#include <linux/aio_abi.h>
+
+#if !SANITIZER_ANDROID
+#include <linux/perf_event.h>
+#endif
+
+namespace __sanitizer {
+ unsigned struct___old_kernel_stat_sz = sizeof(struct __old_kernel_stat);
+ unsigned struct_kernel_stat_sz = sizeof(struct stat);
+ unsigned struct_io_event_sz = sizeof(struct io_event);
+ unsigned struct_iocb_sz = sizeof(struct iocb);
+
+#ifndef _LP64
+ unsigned struct_kernel_stat64_sz = sizeof(struct stat64);
+#else
+ unsigned struct_kernel_stat64_sz = 0;
+#endif
+
+#if !SANITIZER_ANDROID
+ unsigned struct_perf_event_attr_sz = sizeof(struct perf_event_attr);
+#endif
+} // namespace __sanitizer
+
+#endif // SANITIZER_LINUX