diff options
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc index 5a8b13fe442..5f4b24c0f59 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc +++ b/compiler-rt/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 |