1 //===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines macro telling whether sanitizer tools can/should intercept 11 // given library functions on a given platform. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #include "sanitizer_internal_defs.h" 16 17 #if !defined(_WIN32) 18 # define SI_NOT_WINDOWS 1 19 # include "sanitizer_platform_limits_posix.h" 20 #else 21 # define SI_NOT_WINDOWS 0 22 #endif 23 24 #if defined(__linux__) && !defined(ANDROID) 25 # define SI_LINUX_NOT_ANDROID 1 26 #else 27 # define SI_LINUX_NOT_ANDROID 0 28 #endif 29 30 #if defined(__linux__) 31 # define SI_LINUX 1 32 #else 33 # define SI_LINUX 0 34 #endif 35 36 # define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS 37 # define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS 38 # define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS 39 # define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS 40 41 # define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID 42 # define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID 43 # define SANITIZER_INTERCEPT_PRCTL SI_LINUX 44 45 # define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_NOT_WINDOWS 46 47 # define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS 48 # define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX 49 50 # define SANITIZER_INTERCEPT_FREXP 1 51 # define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS 52