2012-12-13 16:50:16 +08:00
|
|
|
//===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines macro telling whether sanitizer tools can/should intercept
|
|
|
|
// given library functions on a given platform.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "sanitizer_internal_defs.h"
|
|
|
|
|
|
|
|
#if !defined(_WIN32)
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SI_NOT_WINDOWS 1
|
2012-12-13 16:50:16 +08:00
|
|
|
#else
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SI_NOT_WINDOWS 0
|
2012-12-13 16:50:16 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__linux__) && !defined(ANDROID)
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SI_LINUX_NOT_ANDROID 1
|
2012-12-13 16:50:16 +08:00
|
|
|
#else
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SI_LINUX_NOT_ANDROID 0
|
2012-12-13 16:50:16 +08:00
|
|
|
#endif
|
|
|
|
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS
|
|
|
|
|
|
|
|
# define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
|
|
|
|
# define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
|
|
|
|
# define SANITIZER_INTERCEPT_PRCTL SI_LINUX_NOT_ANDROID
|
|
|
|
|
2013-01-18 19:17:23 +08:00
|
|
|
# define SANITIZER_INTERCEPT_SCANF 1
|