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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2013-04-24 19:06:05 +08:00
|
|
|
#ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
|
|
|
|
#define SANITIZER_PLATFORM_INTERCEPTORS_H
|
2012-12-13 16:50:16 +08:00
|
|
|
|
|
|
|
#include "sanitizer_internal_defs.h"
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if !SANITIZER_WINDOWS
|
2013-01-18 14:43:13 +08:00
|
|
|
# define SI_NOT_WINDOWS 1
|
2013-02-19 17:19:16 +08:00
|
|
|
# include "sanitizer_platform_limits_posix.h"
|
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
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_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-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX
|
2013-02-20 23:27:58 +08:00
|
|
|
# define SI_LINUX 1
|
|
|
|
#else
|
|
|
|
# define SI_LINUX 0
|
|
|
|
#endif
|
|
|
|
|
2013-04-01 22:47:21 +08:00
|
|
|
#if SANITIZER_MAC
|
|
|
|
# define SI_MAC 1
|
|
|
|
#else
|
|
|
|
# define SI_MAC 0
|
|
|
|
#endif
|
|
|
|
|
2013-05-21 17:01:23 +08:00
|
|
|
# define SANITIZER_INTERCEPT_STRCASECMP SI_NOT_WINDOWS
|
|
|
|
|
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
|
|
|
|
|
2013-06-24 18:43:23 +08:00
|
|
|
#define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
|
|
|
|
#define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
|
|
|
|
|
|
|
|
#define SANITIZER_INTERCEPT_READV SI_NOT_WINDOWS
|
|
|
|
#define SANITIZER_INTERCEPT_WRITEV SI_NOT_WINDOWS
|
|
|
|
|
|
|
|
#define SANITIZER_INTERCEPT_PREADV SI_LINUX_NOT_ANDROID
|
|
|
|
#define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID
|
|
|
|
#define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID
|
|
|
|
#define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID
|
|
|
|
|
2013-03-20 15:35:52 +08:00
|
|
|
# define SANITIZER_INTERCEPT_PRCTL SI_LINUX
|
2013-01-18 14:43:13 +08:00
|
|
|
|
2013-02-19 17:19:16 +08:00
|
|
|
# define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_NOT_WINDOWS
|
|
|
|
|
2013-01-21 21:30:08 +08:00
|
|
|
# define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS
|
2013-02-20 23:27:58 +08:00
|
|
|
# define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX
|
2013-03-14 19:34:39 +08:00
|
|
|
|
|
|
|
# define SANITIZER_INTERCEPT_FREXP 1
|
2013-03-15 22:02:21 +08:00
|
|
|
# define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS
|
2013-04-01 22:47:21 +08:00
|
|
|
|
2013-04-23 20:01:20 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \
|
2013-04-03 16:26:03 +08:00
|
|
|
SI_MAC || SI_LINUX_NOT_ANDROID
|
2013-04-01 22:47:21 +08:00
|
|
|
# define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_LINUX
|
|
|
|
# define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS
|
2013-04-08 16:25:22 +08:00
|
|
|
# define SANITIZER_INTERCEPT_TIME SI_NOT_WINDOWS
|
2013-04-09 19:35:13 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID
|
2013-04-09 22:34:59 +08:00
|
|
|
# define SANITIZER_INTERCEPT_WAIT SI_NOT_WINDOWS
|
2013-04-23 22:05:15 +08:00
|
|
|
# define SANITIZER_INTERCEPT_INET SI_NOT_WINDOWS
|
2013-05-21 17:01:23 +08:00
|
|
|
# define SANITIZER_INTERCEPT_PTHREAD_GETSCHEDPARAM SI_NOT_WINDOWS
|
2013-05-22 20:50:26 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETADDRINFO SI_NOT_WINDOWS
|
2013-07-01 21:51:31 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETNAMEINFO SI_NOT_WINDOWS
|
2013-05-22 21:46:22 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETSOCKNAME SI_NOT_WINDOWS
|
2013-05-23 19:10:23 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_GETHOSTBYNAME_R SI_LINUX
|
2013-05-23 19:38:08 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETSOCKOPT SI_NOT_WINDOWS
|
2013-05-29 17:09:58 +08:00
|
|
|
# define SANITIZER_INTERCEPT_ACCEPT SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX
|
2013-05-29 18:03:11 +08:00
|
|
|
# define SANITIZER_INTERCEPT_MODF SI_NOT_WINDOWS
|
2013-05-29 19:30:00 +08:00
|
|
|
# define SANITIZER_INTERCEPT_RECVMSG SI_NOT_WINDOWS
|
2013-05-29 19:49:25 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETPEERNAME SI_NOT_WINDOWS
|
2013-06-07 21:00:47 +08:00
|
|
|
# define SANITIZER_INTERCEPT_IOCTL SI_NOT_WINDOWS
|
2013-06-24 21:56:14 +08:00
|
|
|
# define SANITIZER_INTERCEPT_INET_ATON SI_NOT_WINDOWS
|
2013-06-24 22:25:33 +08:00
|
|
|
# define SANITIZER_INTERCEPT_SYSINFO SI_LINUX
|
2013-06-26 23:00:53 +08:00
|
|
|
# define SANITIZER_INTERCEPT_READDIR SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_READDIR64 SI_LINUX_NOT_ANDROID
|
2013-07-05 16:57:47 +08:00
|
|
|
# define SANITIZER_INTERCEPT_PTRACE SI_LINUX_NOT_ANDROID && \
|
|
|
|
(defined(__i386) || defined (__x86_64))
|
2013-07-02 17:23:45 +08:00
|
|
|
# define SANITIZER_INTERCEPT_SETLOCALE SI_NOT_WINDOWS
|
2013-07-02 21:34:44 +08:00
|
|
|
# define SANITIZER_INTERCEPT_GETCWD SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX
|
2013-07-04 21:19:41 +08:00
|
|
|
# define SANITIZER_INTERCEPT_STRTOIMAX SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_MBSTOWCS SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_MBSNRTOWCS SI_MAC || SI_LINUX_NOT_ANDROID
|
|
|
|
# define SANITIZER_INTERCEPT_WCSTOMBS SI_NOT_WINDOWS
|
|
|
|
# define SANITIZER_INTERCEPT_WCSNRTOMBS SI_MAC || SI_LINUX_NOT_ANDROID
|
2013-07-04 22:03:31 +08:00
|
|
|
# define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX
|
2013-04-24 19:06:05 +08:00
|
|
|
|
|
|
|
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
|