summaryrefslogtreecommitdiff
path: root/lib/interception/interception.h
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-02-07 07:37:12 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-02-07 07:37:12 +0000
commit65e5090c3ca13ebf1061a7043449d1b3561daa6a (patch)
treecf7256a08c52ae1c348970472b290ed2a9e162c2 /lib/interception/interception.h
parent5ba301dfe9a39c02b3faeb0fa252473f1d6e742c (diff)
downloadcompiler-rt-65e5090c3ca13ebf1061a7043449d1b3561daa6a.tar.gz
compiler-rt-65e5090c3ca13ebf1061a7043449d1b3561daa6a.tar.bz2
compiler-rt-65e5090c3ca13ebf1061a7043449d1b3561daa6a.tar.xz
[sanitizer] Fix wrong size of OFF_T on 32-bit platforms.
This broke pread/pwrite interceptors when building without -D_FILE_OFFSET_BITS=64, and always on Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception/interception.h')
-rw-r--r--lib/interception/interception.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/interception/interception.h b/lib/interception/interception.h
index ccebf14c..c8a0543d 100644
--- a/lib/interception/interception.h
+++ b/lib/interception/interception.h
@@ -27,7 +27,10 @@ typedef __sanitizer::uptr SIZE_T;
typedef __sanitizer::sptr SSIZE_T;
typedef __sanitizer::sptr PTRDIFF_T;
typedef __sanitizer::s64 INTMAX_T;
-typedef __sanitizer::u64 OFF_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.
+typedef __sanitizer::uptr OFF_T;
typedef __sanitizer::u64 OFF64_T;
// How to add an interceptor: