Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 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 | //===----------------------------------------------------------------------===// |
Dmitry Vyukov | edd2821 | 2013-04-24 11:06:05 +0000 | [diff] [blame] | 14 | #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H |
| 15 | #define SANITIZER_PLATFORM_INTERCEPTORS_H |
Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 16 | |
| 17 | #include "sanitizer_internal_defs.h" |
| 18 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 19 | #if !SANITIZER_WINDOWS |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 20 | # define SI_NOT_WINDOWS 1 |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 21 | # include "sanitizer_platform_limits_posix.h" |
Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 22 | #else |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 23 | # define SI_NOT_WINDOWS 0 |
Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 24 | #endif |
| 25 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 26 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 27 | # define SI_LINUX_NOT_ANDROID 1 |
Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 28 | #else |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 29 | # define SI_LINUX_NOT_ANDROID 0 |
Alexey Samsonov | 74737d5 | 2012-12-13 08:50:16 +0000 | [diff] [blame] | 30 | #endif |
| 31 | |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 32 | #if SANITIZER_FREEBSD |
| 33 | # define SI_FREEBSD 1 |
| 34 | #else |
| 35 | # define SI_FREEBSD 0 |
| 36 | #endif |
| 37 | |
Evgeniy Stepanov | 24e1372 | 2013-03-19 14:33:38 +0000 | [diff] [blame] | 38 | #if SANITIZER_LINUX |
Alexander Potapenko | 9eab858 | 2013-02-20 15:27:58 +0000 | [diff] [blame] | 39 | # define SI_LINUX 1 |
| 40 | #else |
| 41 | # define SI_LINUX 0 |
| 42 | #endif |
| 43 | |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 44 | #if SANITIZER_MAC |
| 45 | # define SI_MAC 1 |
| 46 | #else |
| 47 | # define SI_MAC 0 |
| 48 | #endif |
| 49 | |
Alexander Potapenko | b8a141f | 2013-10-31 17:38:18 +0000 | [diff] [blame] | 50 | #if SANITIZER_IOS |
| 51 | # define SI_IOS 1 |
| 52 | #else |
| 53 | # define SI_IOS 0 |
| 54 | #endif |
| 55 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 56 | #define SANITIZER_INTERCEPT_STRCMP 1 |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 57 | #define SANITIZER_INTERCEPT_STRSTR 1 |
| 58 | #define SANITIZER_INTERCEPT_STRCASESTR SI_NOT_WINDOWS |
| 59 | #define SANITIZER_INTERCEPT_STRSPN 1 |
| 60 | #define SANITIZER_INTERCEPT_STRPBRK 1 |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 61 | #define SANITIZER_INTERCEPT_TEXTDOMAIN SI_LINUX_NOT_ANDROID |
| 62 | #define SANITIZER_INTERCEPT_STRCASECMP SI_NOT_WINDOWS |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 63 | #define SANITIZER_INTERCEPT_MEMCMP 1 |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 64 | #define SANITIZER_INTERCEPT_MEMCHR 1 |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 65 | #define SANITIZER_INTERCEPT_MEMRCHR SI_FREEBSD || SI_LINUX |
Evgeniy Stepanov | f495479 | 2013-05-21 09:01:23 +0000 | [diff] [blame] | 66 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 67 | #define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS |
| 68 | #define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS |
| 69 | #define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS |
| 70 | #define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 71 | |
Evgeniy Stepanov | b916e6a | 2013-06-24 10:43:23 +0000 | [diff] [blame] | 72 | #define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID |
| 73 | #define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID |
| 74 | |
| 75 | #define SANITIZER_INTERCEPT_READV SI_NOT_WINDOWS |
| 76 | #define SANITIZER_INTERCEPT_WRITEV SI_NOT_WINDOWS |
| 77 | |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 78 | #define SANITIZER_INTERCEPT_PREADV SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Evgeniy Stepanov | b916e6a | 2013-06-24 10:43:23 +0000 | [diff] [blame] | 79 | #define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID |
| 80 | #define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID |
| 81 | #define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID |
| 82 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 83 | #define SANITIZER_INTERCEPT_PRCTL SI_LINUX |
Kostya Serebryany | c20b321 | 2013-01-18 06:43:13 +0000 | [diff] [blame] | 84 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 85 | #define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_NOT_WINDOWS |
| 86 | #define SANITIZER_INTERCEPT_STRPTIME SI_NOT_WINDOWS |
Evgeniy Stepanov | 9358c58 | 2013-02-19 09:19:16 +0000 | [diff] [blame] | 87 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 88 | #define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 89 | #define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX_NOT_ANDROID |
Evgeniy Stepanov | 7cbbb29 | 2013-03-14 11:34:39 +0000 | [diff] [blame] | 90 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 91 | #ifndef SANITIZER_INTERCEPT_PRINTF |
| 92 | # define SANITIZER_INTERCEPT_PRINTF SI_NOT_WINDOWS |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 93 | # define SANITIZER_INTERCEPT_PRINTF_L SI_FREEBSD |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 94 | # define SANITIZER_INTERCEPT_ISOC99_PRINTF SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 95 | #endif |
Evgeniy Stepanov | e4bdda5 | 2013-04-01 14:47:21 +0000 | [diff] [blame] | 96 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 97 | #define SANITIZER_INTERCEPT_FREXP 1 |
| 98 | #define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS |
| 99 | |
| 100 | #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS |
| 101 | #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 102 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
| 103 | #define SANITIZER_INTERCEPT_GETPWENT \ |
| 104 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 105 | #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 106 | #define SANITIZER_INTERCEPT_GETPWENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 107 | #define SANITIZER_INTERCEPT_SETPWENT SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 108 | #define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_FREEBSD || SI_LINUX |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 109 | #define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS |
| 110 | #define SANITIZER_INTERCEPT_TIME SI_NOT_WINDOWS |
| 111 | #define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID |
| 112 | #define SANITIZER_INTERCEPT_WAIT SI_NOT_WINDOWS |
| 113 | #define SANITIZER_INTERCEPT_INET SI_NOT_WINDOWS |
| 114 | #define SANITIZER_INTERCEPT_PTHREAD_GETSCHEDPARAM SI_NOT_WINDOWS |
| 115 | #define SANITIZER_INTERCEPT_GETADDRINFO SI_NOT_WINDOWS |
| 116 | #define SANITIZER_INTERCEPT_GETNAMEINFO SI_NOT_WINDOWS |
| 117 | #define SANITIZER_INTERCEPT_GETSOCKNAME SI_NOT_WINDOWS |
| 118 | #define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_NOT_WINDOWS |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 119 | #define SANITIZER_INTERCEPT_GETHOSTBYNAME_R SI_FREEBSD || SI_LINUX |
| 120 | #define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R SI_FREEBSD || SI_LINUX_NOT_ANDROID |
| 121 | #define SANITIZER_INTERCEPT_GETHOSTBYADDR_R SI_FREEBSD || SI_LINUX_NOT_ANDROID |
| 122 | #define SANITIZER_INTERCEPT_GETHOSTENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 123 | #define SANITIZER_INTERCEPT_GETSOCKOPT SI_NOT_WINDOWS |
| 124 | #define SANITIZER_INTERCEPT_ACCEPT SI_NOT_WINDOWS |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 125 | #define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 126 | #define SANITIZER_INTERCEPT_MODF SI_NOT_WINDOWS |
| 127 | #define SANITIZER_INTERCEPT_RECVMSG SI_NOT_WINDOWS |
| 128 | #define SANITIZER_INTERCEPT_GETPEERNAME SI_NOT_WINDOWS |
| 129 | #define SANITIZER_INTERCEPT_IOCTL SI_NOT_WINDOWS |
| 130 | #define SANITIZER_INTERCEPT_INET_ATON SI_NOT_WINDOWS |
| 131 | #define SANITIZER_INTERCEPT_SYSINFO SI_LINUX |
| 132 | #define SANITIZER_INTERCEPT_READDIR SI_NOT_WINDOWS |
| 133 | #define SANITIZER_INTERCEPT_READDIR64 SI_LINUX_NOT_ANDROID |
| 134 | #define SANITIZER_INTERCEPT_PTRACE SI_LINUX_NOT_ANDROID && \ |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 135 | (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ |
| 136 | defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__)) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 137 | #define SANITIZER_INTERCEPT_SETLOCALE SI_NOT_WINDOWS |
| 138 | #define SANITIZER_INTERCEPT_GETCWD SI_NOT_WINDOWS |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 139 | #define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 140 | #define SANITIZER_INTERCEPT_STRTOIMAX SI_NOT_WINDOWS |
| 141 | #define SANITIZER_INTERCEPT_MBSTOWCS SI_NOT_WINDOWS |
| 142 | #define SANITIZER_INTERCEPT_MBSNRTOWCS SI_MAC || SI_LINUX_NOT_ANDROID |
| 143 | #define SANITIZER_INTERCEPT_WCSTOMBS SI_NOT_WINDOWS |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 144 | #define SANITIZER_INTERCEPT_WCSNRTOMBS \ |
| 145 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 146 | #define SANITIZER_INTERCEPT_WCRTOMB \ |
| 147 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 148 | #define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 149 | #define SANITIZER_INTERCEPT_REALPATH SI_NOT_WINDOWS |
| 150 | #define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 151 | #define SANITIZER_INTERCEPT_CONFSTR \ |
| 152 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 153 | #define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 154 | #define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 155 | #define SANITIZER_INTERCEPT_STRERROR SI_NOT_WINDOWS |
| 156 | #define SANITIZER_INTERCEPT_STRERROR_R SI_NOT_WINDOWS |
| 157 | #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 158 | #define SANITIZER_INTERCEPT_SCANDIR \ |
| 159 | SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 160 | #define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID |
| 161 | #define SANITIZER_INTERCEPT_GETGROUPS SI_NOT_WINDOWS |
| 162 | #define SANITIZER_INTERCEPT_POLL SI_NOT_WINDOWS |
| 163 | #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 164 | #define SANITIZER_INTERCEPT_WORDEXP \ |
| 165 | SI_FREEBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 166 | #define SANITIZER_INTERCEPT_SIGWAIT SI_NOT_WINDOWS |
| 167 | #define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID |
| 168 | #define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 169 | #define SANITIZER_INTERCEPT_SIGSETOPS \ |
| 170 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 171 | #define SANITIZER_INTERCEPT_SIGPENDING SI_NOT_WINDOWS |
| 172 | #define SANITIZER_INTERCEPT_SIGPROCMASK SI_NOT_WINDOWS |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 173 | #define SANITIZER_INTERCEPT_BACKTRACE SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 174 | #define SANITIZER_INTERCEPT_GETMNTENT SI_LINUX |
| 175 | #define SANITIZER_INTERCEPT_GETMNTENT_R SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 176 | #define SANITIZER_INTERCEPT_STATFS SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 177 | #define SANITIZER_INTERCEPT_STATFS64 \ |
| 178 | (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 179 | #define SANITIZER_INTERCEPT_STATVFS SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 180 | #define SANITIZER_INTERCEPT_STATVFS64 SI_LINUX_NOT_ANDROID |
| 181 | #define SANITIZER_INTERCEPT_INITGROUPS SI_NOT_WINDOWS |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 182 | #define SANITIZER_INTERCEPT_ETHER_NTOA_ATON SI_NOT_WINDOWS |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 183 | #define SANITIZER_INTERCEPT_ETHER_HOST \ |
| 184 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
| 185 | #define SANITIZER_INTERCEPT_ETHER_R SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 186 | #define SANITIZER_INTERCEPT_SHMCTL \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 187 | ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && SANITIZER_WORDSIZE == 64) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 188 | #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID |
| 189 | #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_NOT_WINDOWS |
| 190 | #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 191 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 192 | #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETAFFINITY_NP SI_LINUX_NOT_ANDROID |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 193 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPSHARED SI_NOT_WINDOWS |
| 194 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETTYPE SI_NOT_WINDOWS |
| 195 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPROTOCOL \ |
| 196 | SI_MAC || SI_LINUX_NOT_ANDROID |
| 197 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPRIOCEILING \ |
| 198 | SI_MAC || SI_LINUX_NOT_ANDROID |
| 199 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST SI_LINUX_NOT_ANDROID |
| 200 | #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST_NP SI_LINUX_NOT_ANDROID |
| 201 | #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETPSHARED SI_NOT_WINDOWS |
| 202 | #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETKIND_NP SI_LINUX_NOT_ANDROID |
| 203 | #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETPSHARED SI_NOT_WINDOWS |
| 204 | #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETCLOCK SI_LINUX_NOT_ANDROID |
| 205 | #define SANITIZER_INTERCEPT_PTHREAD_BARRIERATTR_GETPSHARED SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 206 | #define SANITIZER_INTERCEPT_TMPNAM SI_NOT_WINDOWS |
| 207 | #define SANITIZER_INTERCEPT_TMPNAM_R SI_LINUX_NOT_ANDROID |
| 208 | #define SANITIZER_INTERCEPT_TEMPNAM SI_NOT_WINDOWS |
| 209 | #define SANITIZER_INTERCEPT_SINCOS SI_LINUX |
| 210 | #define SANITIZER_INTERCEPT_REMQUO SI_NOT_WINDOWS |
| 211 | #define SANITIZER_INTERCEPT_LGAMMA SI_NOT_WINDOWS |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 212 | #define SANITIZER_INTERCEPT_LGAMMA_R SI_FREEBSD || SI_LINUX |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 213 | #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 214 | #define SANITIZER_INTERCEPT_DRAND48_R SI_LINUX_NOT_ANDROID |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 215 | #define SANITIZER_INTERCEPT_RAND_R \ |
| 216 | SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID |
| 217 | #define SANITIZER_INTERCEPT_ICONV SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 218 | #define SANITIZER_INTERCEPT_TIMES SI_NOT_WINDOWS |
Dmitry Vyukov | edd2821 | 2013-04-24 11:06:05 +0000 | [diff] [blame] | 219 | |
Evgeniy Stepanov | 26fe5d3 | 2013-10-31 01:17:41 +0000 | [diff] [blame] | 220 | // FIXME: getline seems to be available on OSX 10.7 |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 221 | #define SANITIZER_INTERCEPT_GETLINE SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Evgeniy Stepanov | 26fe5d3 | 2013-10-31 01:17:41 +0000 | [diff] [blame] | 222 | |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 223 | #define SANITIZER_INTERCEPT__EXIT SI_LINUX || SI_FREEBSD || SI_MAC |
Dmitry Vyukov | 14dd980 | 2013-10-03 15:22:29 +0000 | [diff] [blame] | 224 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 225 | #define SANITIZER_INTERCEPT_PHTREAD_MUTEX SI_NOT_WINDOWS |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 226 | #define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP \ |
| 227 | SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 228 | |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 229 | #define SANITIZER_INTERCEPT_TLS_GET_ADDR \ |
| 230 | SI_FREEBSD || SI_LINUX_NOT_ANDROID |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 231 | |
| 232 | #define SANITIZER_INTERCEPT_LISTXATTR SI_LINUX |
| 233 | #define SANITIZER_INTERCEPT_GETXATTR SI_LINUX |
| 234 | #define SANITIZER_INTERCEPT_GETRESID SI_LINUX |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 235 | #define SANITIZER_INTERCEPT_GETIFADDRS \ |
| 236 | SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC |
| 237 | #define SANITIZER_INTERCEPT_IF_INDEXTONAME \ |
| 238 | SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 239 | #define SANITIZER_INTERCEPT_CAPGET SI_LINUX_NOT_ANDROID |
| 240 | #define SANITIZER_INTERCEPT_AEABI_MEM SI_LINUX && defined(__arm__) |
| 241 | #define SANITIZER_INTERCEPT___BZERO SI_MAC |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 242 | #define SANITIZER_INTERCEPT_FTIME !SI_FREEBSD && SI_NOT_WINDOWS |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 243 | #define SANITIZER_INTERCEPT_XDR SI_LINUX_NOT_ANDROID |
| 244 | #define SANITIZER_INTERCEPT_TSEARCH SI_LINUX_NOT_ANDROID || SI_MAC |
| 245 | #define SANITIZER_INTERCEPT_LIBIO_INTERNALS SI_LINUX_NOT_ANDROID |
| 246 | #define SANITIZER_INTERCEPT_FOPEN SI_NOT_WINDOWS |
| 247 | #define SANITIZER_INTERCEPT_FOPEN64 SI_LINUX_NOT_ANDROID |
| 248 | #define SANITIZER_INTERCEPT_OPEN_MEMSTREAM SI_LINUX_NOT_ANDROID |
| 249 | #define SANITIZER_INTERCEPT_OBSTACK SI_LINUX_NOT_ANDROID |
| 250 | #define SANITIZER_INTERCEPT_FFLUSH SI_NOT_WINDOWS |
| 251 | #define SANITIZER_INTERCEPT_FCLOSE SI_NOT_WINDOWS |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 252 | #define SANITIZER_INTERCEPT_DLOPEN_DLCLOSE \ |
| 253 | SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC |
| 254 | #define SANITIZER_INTERCEPT_GETPASS SI_LINUX_NOT_ANDROID || SI_MAC |
| 255 | #define SANITIZER_INTERCEPT_TIMERFD SI_LINUX_NOT_ANDROID |
| 256 | |
| 257 | #define SANITIZER_INTERCEPT_MLOCKX SI_NOT_WINDOWS |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 258 | #define SANITIZER_INTERCEPT_FOPENCOOKIE SI_LINUX_NOT_ANDROID |
| 259 | #define SANITIZER_INTERCEPT_SEM SI_LINUX || SI_FREEBSD |
| 260 | #define SANITIZER_INTERCEPT_PTHREAD_SETCANCEL SI_NOT_WINDOWS |
| 261 | #define SANITIZER_INTERCEPT_MINCORE SI_LINUX |
| 262 | #define SANITIZER_INTERCEPT_PROCESS_VM_READV SI_LINUX |
| 263 | #define SANITIZER_INTERCEPT_CTERMID SI_LINUX || SI_MAC || SI_FREEBSD |
| 264 | #define SANITIZER_INTERCEPT_CTERMID_R SI_MAC || SI_FREEBSD |
| 265 | |
| 266 | #define SANITIZER_INTERCEPTOR_HOOKS SI_LINUX |
Alexey Samsonov | 5e2d377 | 2013-10-16 08:20:31 +0000 | [diff] [blame] | 267 | |
Dmitry Vyukov | edd2821 | 2013-04-24 11:06:05 +0000 | [diff] [blame] | 268 | #endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H |