aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2020-08-18 13:06:41 -0700
committerPeter Collingbourne <peter@pcc.me.uk>2020-08-19 10:55:55 -0700
commita208ad5ddb5bbcf773dae82d37755dc109dab483 (patch)
tree5b8c75c3a7cb369c2b40dbad06f844742f2ed9fe
parent455688e293fa86d5e6de6f96740bc67dce34a179 (diff)
downloadllvm-a208ad5ddb5bbcf773dae82d37755dc109dab483.zip
llvm-a208ad5ddb5bbcf773dae82d37755dc109dab483.tar.gz
llvm-a208ad5ddb5bbcf773dae82d37755dc109dab483.tar.bz2
sanitizer_common: Use void* for madvise first argument on Solaris.
Differential Revision: https://reviews.llvm.org/D86166
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
index cce179a..7f9a3e9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -76,10 +76,16 @@ DECLARE__REAL_AND_INTERNAL(int, mprotect, void *addr, uptr length, int prot) {
// Illumos' declaration of madvise cannot be made visible if _XOPEN_SOURCE
// is defined as g++ does on Solaris.
-extern "C" int madvise(caddr_t, size_t, int);
+//
+// This declaration is consistent with Solaris 11.4. Both Illumos and Solaris
+// versions older than 11.4 declared madvise with a caddr_t as the first
+// argument, but we don't currently support Solaris versions older than 11.4,
+// and as mentioned above the declaration is not visible on Illumos so we can
+// use any declaration we like on Illumos.
+extern "C" int madvise(void *, size_t, int);
int internal_madvise(uptr addr, uptr length, int advice) {
- return madvise((caddr_t)addr, length, advice);
+ return madvise((void *)addr, length, advice);
}
DECLARE__REAL_AND_INTERNAL(uptr, close, fd_t fd) {