summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common_syscalls.inc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-07-30 13:04:43 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-07-30 13:04:43 +0000
commit9d34659cd3570423fb1fa49248887e2bd4b762f9 (patch)
tree91bdcf06b6b0edabf9ea58ae00d9627cfb51e87e /lib/sanitizer_common/sanitizer_common_syscalls.inc
parent6567092b06b37195cd93d57204bcbfe6843b2a48 (diff)
[sanitizer] read() syscall hook.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_syscalls.inc')
-rw-r--r--lib/sanitizer_common/sanitizer_common_syscalls.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
index 5a8b13fe4..5f4b24c0f 100644
--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -161,6 +161,15 @@ POST_SYSCALL(clock_getres)(long res, int clk_id,
struct sanitizer_kernel_timespec *tp) {
if (res == 0 && tp) POST_WRITE(tp, sizeof(*tp));
}
+
+PRE_SYSCALL(read)(unsigned int fd, char *buf, uptr count) {
+ if (buf) PRE_WRITE(buf, count);
+}
+
+POST_SYSCALL(read)(long res, unsigned int fd, char *buf, uptr count) {
+ if (res > 0 && buf) POST_WRITE(buf, res);
+}
+
} // extern "C"
#undef PRE_SYSCALL