summaryrefslogtreecommitdiff
path: root/lib/interception/interception.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-27 11:22:40 +0000
committerKostya Serebryany <kcc@google.com>2013-02-27 11:22:40 +0000
commit6fb47af2d2d305adbfc3d41bea589d1527a364a9 (patch)
treebf89a18e0c1e0b5585d7fe41d94fb79bcf515580 /lib/interception/interception.h
parent1d2ed3ab71a574aaa0f4cea21333ae2bb786c93a (diff)
downloadcompiler-rt-6fb47af2d2d305adbfc3d41bea589d1527a364a9.tar.gz
compiler-rt-6fb47af2d2d305adbfc3d41bea589d1527a364a9.tar.bz2
compiler-rt-6fb47af2d2d305adbfc3d41bea589d1527a364a9.tar.xz
add Linux syscall wrappers and ThreadLister to sanitizer_common
ThreadLister is a Linux-specific class for obtaining the thread IDs of a process from procfs (/proc/<pid>/task/). It will be used by leak checking code. Also add several syscall wrappers which will be required by the same code that uses ThreadLister, but are not used in ThreadLister itself. Patch by Sergey Matveev git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception/interception.h')
-rw-r--r--lib/interception/interception.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/interception/interception.h b/lib/interception/interception.h
index b6be72c6..2ccc9038 100644
--- a/lib/interception/interception.h
+++ b/lib/interception/interception.h
@@ -23,20 +23,12 @@
// These typedefs should be used only in the interceptor definitions to replace
// the standard system types (e.g. SSIZE_T instead of ssize_t)
-typedef __sanitizer::uptr SIZE_T;
-typedef __sanitizer::sptr SSIZE_T;
-typedef __sanitizer::sptr PTRDIFF_T;
-typedef __sanitizer::s64 INTMAX_T;
-// WARNING: OFF_T may be different from OS type off_t, depending on the value of
-// _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls
-// like pread and mmap, as opposed to pread64 and mmap64.
-// Mac and Linux/x86-64 are special.
-#if defined(__APPLE__) || (defined(__linux__) && defined(__x86_64__))
-typedef __sanitizer::u64 OFF_T;
-#else
-typedef __sanitizer::uptr OFF_T;
-#endif
-typedef __sanitizer::u64 OFF64_T;
+typedef __sanitizer::uptr SIZE_T;
+typedef __sanitizer::sptr SSIZE_T;
+typedef __sanitizer::sptr PTRDIFF_T;
+typedef __sanitizer::s64 INTMAX_T;
+typedef __sanitizer::OFF_T OFF_T;
+typedef __sanitizer::OFF64_T OFF64_T;
// How to add an interceptor:
// Suppose you need to wrap/replace system function (generally, from libc):