//===-- tsan_platform_posix.cpp -------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // POSIX-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_POSIX # include <dlfcn.h> # include "sanitizer_common/sanitizer_common.h" # include "sanitizer_common/sanitizer_errno.h" # include "sanitizer_common/sanitizer_libc.h" # include "sanitizer_common/sanitizer_procmaps.h" # include "tsan_platform.h" # include "tsan_rtl.h" namespace __tsan { static const char kShadowMemoryMappingWarning[] = …; static const char kShadowMemoryMappingHint[] = …; # if !SANITIZER_GO void DontDumpShadow(uptr addr, uptr size) { … } void InitializeShadowMemory() { … } static bool TryProtectRange(uptr beg, uptr end) { … } static void ProtectRange(uptr beg, uptr end) { … } // CheckAndProtect will check if the memory layout is compatible with TSan. // Optionally (if 'protect' is true), it will set the memory regions between // app memory to be inaccessible. // 'ignore_heap' means it will not consider heap memory allocations to be a // conflict. Set this based on whether we are calling CheckAndProtect before // or after the allocator has initialized the heap. bool CheckAndProtect(bool protect, bool ignore_heap, bool print_warnings) { … } # endif } // namespace __tsan #endif // SANITIZER_POSIX