diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-02-04 10:16:50 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-02-04 10:16:50 +0000 |
commit | 4c9317a7b61e136f832d2ede70f557963fd46bce (patch) | |
tree | a5d22536202cf0c70a3deaccebd74830fb361d6c /lib/sanitizer_common/sanitizer_mac.cc | |
parent | 8ceeec4f343768b199e7c891865029360b7225dc (diff) | |
download | compiler-rt-4c9317a7b61e136f832d2ede70f557963fd46bce.tar.gz compiler-rt-4c9317a7b61e136f832d2ede70f557963fd46bce.tar.bz2 compiler-rt-4c9317a7b61e136f832d2ede70f557963fd46bce.tar.xz |
[Sanitizer] extend internal libc with stat/fstat/lstat functions
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_mac.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_mac.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_mac.cc b/lib/sanitizer_common/sanitizer_mac.cc index a7bde030..1bd50ca1 100644 --- a/lib/sanitizer_common/sanitizer_mac.cc +++ b/lib/sanitizer_common/sanitizer_mac.cc @@ -69,9 +69,21 @@ uptr internal_write(fd_t fd, const void *buf, uptr count) { return write(fd, buf, count); } +int internal_stat(const char *path, void *buf) { + return stat(path, buf); +} + +int internal_lstat(const char *path, void *buf) { + return lstat(path, buf); +} + +int internal_fstat(fd_t fd, void *buf) { + return fstat(fd, buf); +} + uptr internal_filesize(fd_t fd) { struct stat st; - if (fstat(fd, &st)) + if (internal_fstat(fd, &st)) return -1; return (uptr)st.st_size; } |