diff options
author | Kamil Rytarowski <n54@gmx.com> | 2018-01-03 22:28:39 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2018-01-03 22:28:39 +0000 |
commit | 127df3a5936479c254feb916ed97980c0a4f8931 (patch) | |
tree | a9ac463654912319db48c15361e0447d65ed37fb /test/msan | |
parent | 3e3b3f00625ddb8dd56f1ee362855574071e9258 (diff) |
Add MSan interceptor for fstat(2)
Summary:
Add new MSan interceptor that corrects NetBSD's
specific handling of fstat(2).
NetBSD renames the call to __fstat50.
Add new test: test/msan/fstat.cc
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D41637
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/msan')
-rw-r--r-- | test/msan/fstat.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/msan/fstat.cc b/test/msan/fstat.cc new file mode 100644 index 000000000..83f97054c --- /dev/null +++ b/test/msan/fstat.cc @@ -0,0 +1,15 @@ +// RUN: %clangxx_msan -O0 %s -o %t && %run %t + +#include <sys/stat.h> +#include <stdlib.h> + +int main(void) { + struct stat st; + if (fstat(0, &st)) + exit(1); + + if (S_ISBLK(st.st_mode)) + exit(0); + + return 0; +} |