[asan] use raw syscalls for open/close on linux to avoid being intercepted

llvm-svn: 149892
This commit is contained in:
Kostya Serebryany 2012-02-06 19:23:38 +00:00
parent 2eb6c3d246
commit 546ba363ea
1 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ size_t AsanWrite(int fd, const void *buf, size_t count) {
} }
int AsanOpenReadonly(const char* filename) { int AsanOpenReadonly(const char* filename) {
return open(filename, O_RDONLY); return syscall(__NR_open, filename, O_RDONLY);
} }
// Like getenv, but reads env directly from /proc and does not use libc. // Like getenv, but reads env directly from /proc and does not use libc.
@ -154,7 +154,7 @@ size_t AsanRead(int fd, void *buf, size_t count) {
} }
int AsanClose(int fd) { int AsanClose(int fd) {
return close(fd); return syscall(__NR_close, fd);
} }
AsanProcMaps::AsanProcMaps() { AsanProcMaps::AsanProcMaps() {