libcpp: remove redundant parameter from rich_location::set_range
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_platform_interceptors.h
blobb9eb09ad3bd8e083b92aaeb5d08b8f3707f7b09d
1 //===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file defines macro telling whether sanitizer tools can/should intercept
9 // given library functions on a given platform.
11 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
13 #define SANITIZER_PLATFORM_INTERCEPTORS_H
15 #include "sanitizer_internal_defs.h"
17 #if SANITIZER_POSIX
18 # define SI_POSIX 1
19 #else
20 # define SI_POSIX 0
21 #endif
23 #if !SANITIZER_WINDOWS
24 # define SI_WINDOWS 0
25 #else
26 # define SI_WINDOWS 1
27 #endif
29 #if (SI_POSIX != 0) == (SI_WINDOWS != 0) && !SANITIZER_FUCHSIA
30 # error "Windows is not POSIX!"
31 #endif
33 #if SI_POSIX
34 # include "sanitizer_platform_limits_netbsd.h"
35 # include "sanitizer_platform_limits_posix.h"
36 #endif
38 #if SANITIZER_LINUX && !SANITIZER_ANDROID
39 # define SI_LINUX_NOT_ANDROID 1
40 #else
41 # define SI_LINUX_NOT_ANDROID 0
42 #endif
44 #if SANITIZER_ANDROID
45 # define SI_ANDROID 1
46 #else
47 # define SI_ANDROID 0
48 #endif
50 #if SANITIZER_FREEBSD
51 # define SI_FREEBSD 1
52 #else
53 # define SI_FREEBSD 0
54 #endif
56 #if SANITIZER_NETBSD
57 # define SI_NETBSD 1
58 #else
59 # define SI_NETBSD 0
60 #endif
62 #if SANITIZER_LINUX
63 # define SI_LINUX 1
64 #else
65 # define SI_LINUX 0
66 #endif
68 #if SANITIZER_MAC
69 # define SI_MAC 1
70 # define SI_NOT_MAC 0
71 #else
72 # define SI_MAC 0
73 # define SI_NOT_MAC 1
74 #endif
76 #if SANITIZER_IOS
77 # define SI_IOS 1
78 #else
79 # define SI_IOS 0
80 #endif
82 #if SANITIZER_FUCHSIA
83 # define SI_NOT_FUCHSIA 0
84 #else
85 # define SI_NOT_FUCHSIA 1
86 #endif
88 #if SANITIZER_POSIX && !SANITIZER_MAC
89 # define SI_POSIX_NOT_MAC 1
90 #else
91 # define SI_POSIX_NOT_MAC 0
92 #endif
94 #if SANITIZER_LINUX && !SANITIZER_FREEBSD
95 # define SI_LINUX_NOT_FREEBSD 1
96 # else
97 # define SI_LINUX_NOT_FREEBSD 0
98 #endif
100 #define SANITIZER_INTERCEPT_STRLEN SI_NOT_FUCHSIA
101 #define SANITIZER_INTERCEPT_STRNLEN (SI_NOT_MAC && SI_NOT_FUCHSIA)
102 #define SANITIZER_INTERCEPT_STRCMP SI_NOT_FUCHSIA
103 #define SANITIZER_INTERCEPT_STRSTR SI_NOT_FUCHSIA
104 #define SANITIZER_INTERCEPT_STRCASESTR SI_POSIX
105 #define SANITIZER_INTERCEPT_STRTOK SI_NOT_FUCHSIA
106 #define SANITIZER_INTERCEPT_STRCHR SI_NOT_FUCHSIA
107 #define SANITIZER_INTERCEPT_STRCHRNUL SI_POSIX_NOT_MAC
108 #define SANITIZER_INTERCEPT_STRRCHR SI_NOT_FUCHSIA
109 #define SANITIZER_INTERCEPT_STRSPN SI_NOT_FUCHSIA
110 #define SANITIZER_INTERCEPT_STRPBRK SI_NOT_FUCHSIA
111 #define SANITIZER_INTERCEPT_TEXTDOMAIN SI_LINUX_NOT_ANDROID
112 #define SANITIZER_INTERCEPT_STRCASECMP SI_POSIX
113 #define SANITIZER_INTERCEPT_MEMSET 1
114 #define SANITIZER_INTERCEPT_MEMMOVE 1
115 #define SANITIZER_INTERCEPT_MEMCPY 1
116 #define SANITIZER_INTERCEPT_MEMCMP SI_NOT_FUCHSIA
117 #define SANITIZER_INTERCEPT_STRNDUP SI_POSIX
118 #define SANITIZER_INTERCEPT___STRNDUP SI_LINUX_NOT_FREEBSD
119 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
120 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070
121 # define SI_MAC_DEPLOYMENT_BELOW_10_7 1
122 #else
123 # define SI_MAC_DEPLOYMENT_BELOW_10_7 0
124 #endif
125 // memmem on Darwin doesn't exist on 10.6
126 // FIXME: enable memmem on Windows.
127 #define SANITIZER_INTERCEPT_MEMMEM (SI_POSIX && !SI_MAC_DEPLOYMENT_BELOW_10_7)
128 #define SANITIZER_INTERCEPT_MEMCHR SI_NOT_FUCHSIA
129 #define SANITIZER_INTERCEPT_MEMRCHR (SI_FREEBSD || SI_LINUX || SI_NETBSD)
131 #define SANITIZER_INTERCEPT_READ SI_POSIX
132 #define SANITIZER_INTERCEPT_PREAD SI_POSIX
133 #define SANITIZER_INTERCEPT_WRITE SI_POSIX
134 #define SANITIZER_INTERCEPT_PWRITE SI_POSIX
136 #define SANITIZER_INTERCEPT_FREAD SI_POSIX
137 #define SANITIZER_INTERCEPT_FWRITE SI_POSIX
139 #define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
140 #define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
142 #define SANITIZER_INTERCEPT_READV SI_POSIX
143 #define SANITIZER_INTERCEPT_WRITEV SI_POSIX
145 #define SANITIZER_INTERCEPT_PREADV \
146 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
147 #define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID
148 #define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID
149 #define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID
151 #define SANITIZER_INTERCEPT_PRCTL SI_LINUX
153 #define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_POSIX
154 #define SANITIZER_INTERCEPT_STRPTIME SI_POSIX
156 #define SANITIZER_INTERCEPT_SCANF SI_POSIX
157 #define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX_NOT_ANDROID
159 #ifndef SANITIZER_INTERCEPT_PRINTF
160 # define SANITIZER_INTERCEPT_PRINTF SI_POSIX
161 # define SANITIZER_INTERCEPT_PRINTF_L (SI_FREEBSD || SI_NETBSD)
162 # define SANITIZER_INTERCEPT_ISOC99_PRINTF SI_LINUX_NOT_ANDROID
163 #endif
165 #define SANITIZER_INTERCEPT_FREXP SI_NOT_FUCHSIA
166 #define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_POSIX
168 #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_POSIX
169 #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \
170 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
171 #define SANITIZER_INTERCEPT_GETPWENT \
172 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
173 #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID
174 #define SANITIZER_INTERCEPT_GETPWENT_R \
175 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
176 #define SANITIZER_INTERCEPT_SETPWENT (SI_MAC || SI_LINUX_NOT_ANDROID)
177 #define SANITIZER_INTERCEPT_CLOCK_GETTIME (SI_FREEBSD || SI_NETBSD || SI_LINUX)
178 #define SANITIZER_INTERCEPT_GETITIMER SI_POSIX
179 #define SANITIZER_INTERCEPT_TIME SI_POSIX
180 #define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID
181 #define SANITIZER_INTERCEPT_WAIT SI_POSIX
182 #define SANITIZER_INTERCEPT_INET SI_POSIX
183 #define SANITIZER_INTERCEPT_PTHREAD_GETSCHEDPARAM SI_POSIX
184 #define SANITIZER_INTERCEPT_GETADDRINFO SI_POSIX
185 #define SANITIZER_INTERCEPT_GETNAMEINFO SI_POSIX
186 #define SANITIZER_INTERCEPT_GETSOCKNAME SI_POSIX
187 #define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_POSIX
188 #define SANITIZER_INTERCEPT_GETHOSTBYNAME_R (SI_FREEBSD || SI_LINUX)
189 #define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R \
190 (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
191 #define SANITIZER_INTERCEPT_GETHOSTBYADDR_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
192 #define SANITIZER_INTERCEPT_GETHOSTENT_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
193 #define SANITIZER_INTERCEPT_GETSOCKOPT SI_POSIX
194 #define SANITIZER_INTERCEPT_ACCEPT SI_POSIX
195 #define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX_NOT_ANDROID
196 #define SANITIZER_INTERCEPT_MODF SI_POSIX
197 #define SANITIZER_INTERCEPT_RECVMSG SI_POSIX
198 #define SANITIZER_INTERCEPT_SENDMSG SI_POSIX
199 #define SANITIZER_INTERCEPT_GETPEERNAME SI_POSIX
200 #define SANITIZER_INTERCEPT_IOCTL SI_POSIX
201 #define SANITIZER_INTERCEPT_INET_ATON SI_POSIX
202 #define SANITIZER_INTERCEPT_SYSINFO SI_LINUX
203 #define SANITIZER_INTERCEPT_READDIR SI_POSIX
204 #define SANITIZER_INTERCEPT_READDIR64 SI_LINUX_NOT_ANDROID
205 #if SI_LINUX_NOT_ANDROID && \
206 (defined(__i386) || defined(__x86_64) || defined(__mips64) || \
207 defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \
208 defined(__s390__))
209 #define SANITIZER_INTERCEPT_PTRACE 1
210 #else
211 #define SANITIZER_INTERCEPT_PTRACE 0
212 #endif
213 #define SANITIZER_INTERCEPT_SETLOCALE SI_POSIX
214 #define SANITIZER_INTERCEPT_GETCWD SI_POSIX
215 #define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX_NOT_ANDROID
216 #define SANITIZER_INTERCEPT_STRTOIMAX SI_POSIX
217 #define SANITIZER_INTERCEPT_MBSTOWCS SI_POSIX
218 #define SANITIZER_INTERCEPT_MBSNRTOWCS (SI_MAC || SI_LINUX_NOT_ANDROID)
219 #define SANITIZER_INTERCEPT_WCSTOMBS SI_POSIX
220 #define SANITIZER_INTERCEPT_WCSNRTOMBS \
221 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
222 #define SANITIZER_INTERCEPT_WCRTOMB \
223 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
224 #define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX_NOT_ANDROID
225 #define SANITIZER_INTERCEPT_REALPATH SI_POSIX
226 #define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME SI_LINUX_NOT_ANDROID
227 #define SANITIZER_INTERCEPT_CONFSTR \
228 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
229 #define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID
230 #define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID
231 #define SANITIZER_INTERCEPT_STRERROR SI_POSIX
232 #define SANITIZER_INTERCEPT_STRERROR_R SI_POSIX
233 #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID
234 #define SANITIZER_INTERCEPT_SCANDIR \
235 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
236 #define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID
237 #define SANITIZER_INTERCEPT_GETGROUPS SI_POSIX
238 #define SANITIZER_INTERCEPT_POLL SI_POSIX
239 #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID
240 #define SANITIZER_INTERCEPT_WORDEXP \
241 (SI_FREEBSD || SI_NETBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID)
242 #define SANITIZER_INTERCEPT_SIGWAIT SI_POSIX
243 #define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID
244 #define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID
245 #define SANITIZER_INTERCEPT_SIGSETOPS \
246 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
247 #define SANITIZER_INTERCEPT_SIGPENDING SI_POSIX
248 #define SANITIZER_INTERCEPT_SIGPROCMASK SI_POSIX
249 #define SANITIZER_INTERCEPT_BACKTRACE \
250 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
251 #define SANITIZER_INTERCEPT_GETMNTENT SI_LINUX
252 #define SANITIZER_INTERCEPT_GETMNTENT_R SI_LINUX_NOT_ANDROID
253 #define SANITIZER_INTERCEPT_STATFS \
254 (SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
255 #define SANITIZER_INTERCEPT_STATFS64 \
256 ((SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID)
257 #define SANITIZER_INTERCEPT_STATVFS \
258 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
259 #define SANITIZER_INTERCEPT_STATVFS64 SI_LINUX_NOT_ANDROID
260 #define SANITIZER_INTERCEPT_INITGROUPS SI_POSIX
261 #define SANITIZER_INTERCEPT_ETHER_NTOA_ATON SI_POSIX
262 #define SANITIZER_INTERCEPT_ETHER_HOST \
263 (SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
264 #define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
265 #define SANITIZER_INTERCEPT_SHMCTL \
266 (SI_NETBSD || ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \
267 SANITIZER_WORDSIZE == 64)) // NOLINT
268 #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID
269 #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
270 #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \
271 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
272 #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETAFFINITY_NP SI_LINUX_NOT_ANDROID
273 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPSHARED SI_POSIX
274 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETTYPE SI_POSIX
275 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPROTOCOL \
276 (SI_MAC || SI_NETBSD || SI_LINUX_NOT_ANDROID)
277 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPRIOCEILING \
278 (SI_MAC || SI_NETBSD || SI_LINUX_NOT_ANDROID)
279 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST SI_LINUX_NOT_ANDROID
280 #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST_NP SI_LINUX_NOT_ANDROID
281 #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETPSHARED SI_POSIX
282 #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETKIND_NP SI_LINUX_NOT_ANDROID
283 #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETPSHARED SI_POSIX
284 #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETCLOCK SI_LINUX_NOT_ANDROID
285 #define SANITIZER_INTERCEPT_PTHREAD_BARRIERATTR_GETPSHARED SI_LINUX_NOT_ANDROID
286 #define SANITIZER_INTERCEPT_TMPNAM SI_POSIX
287 #define SANITIZER_INTERCEPT_TMPNAM_R SI_LINUX_NOT_ANDROID
288 #define SANITIZER_INTERCEPT_TTYNAME_R SI_POSIX
289 #define SANITIZER_INTERCEPT_TEMPNAM SI_POSIX
290 #define SANITIZER_INTERCEPT_SINCOS SI_LINUX
291 #define SANITIZER_INTERCEPT_REMQUO SI_POSIX
292 #define SANITIZER_INTERCEPT_LGAMMA SI_POSIX
293 #define SANITIZER_INTERCEPT_LGAMMA_R (SI_FREEBSD || SI_LINUX)
294 #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID
295 #define SANITIZER_INTERCEPT_DRAND48_R SI_LINUX_NOT_ANDROID
296 #define SANITIZER_INTERCEPT_RAND_R \
297 (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
298 #define SANITIZER_INTERCEPT_ICONV \
299 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
300 #define SANITIZER_INTERCEPT_TIMES SI_POSIX
302 // FIXME: getline seems to be available on OSX 10.7
303 #define SANITIZER_INTERCEPT_GETLINE \
304 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
306 #define SANITIZER_INTERCEPT__EXIT \
307 (SI_LINUX || SI_FREEBSD || SI_NETBSD || SI_MAC)
309 #define SANITIZER_INTERCEPT_PHTREAD_MUTEX SI_POSIX
310 #define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP \
311 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
313 #define SANITIZER_INTERCEPT_TLS_GET_ADDR \
314 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID)
316 #define SANITIZER_INTERCEPT_LISTXATTR SI_LINUX
317 #define SANITIZER_INTERCEPT_GETXATTR SI_LINUX
318 #define SANITIZER_INTERCEPT_GETRESID SI_LINUX
319 #define SANITIZER_INTERCEPT_GETIFADDRS \
320 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_MAC)
321 #define SANITIZER_INTERCEPT_IF_INDEXTONAME \
322 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_MAC)
323 #define SANITIZER_INTERCEPT_CAPGET SI_LINUX_NOT_ANDROID
324 #if SI_LINUX && defined(__arm__)
325 #define SANITIZER_INTERCEPT_AEABI_MEM 1
326 #else
327 #define SANITIZER_INTERCEPT_AEABI_MEM 0
328 #endif
329 #define SANITIZER_INTERCEPT___BZERO SI_MAC
330 #define SANITIZER_INTERCEPT_FTIME (!SI_FREEBSD && !SI_NETBSD && SI_POSIX)
331 #define SANITIZER_INTERCEPT_XDR SI_LINUX_NOT_ANDROID
332 #define SANITIZER_INTERCEPT_TSEARCH \
333 (SI_LINUX_NOT_ANDROID || SI_MAC || SI_NETBSD)
334 #define SANITIZER_INTERCEPT_LIBIO_INTERNALS SI_LINUX_NOT_ANDROID
335 #define SANITIZER_INTERCEPT_FOPEN SI_POSIX
336 #define SANITIZER_INTERCEPT_FOPEN64 SI_LINUX_NOT_ANDROID
337 #define SANITIZER_INTERCEPT_OPEN_MEMSTREAM (SI_LINUX_NOT_ANDROID || SI_NETBSD)
338 #define SANITIZER_INTERCEPT_OBSTACK SI_LINUX_NOT_ANDROID
339 #define SANITIZER_INTERCEPT_FFLUSH SI_POSIX
340 #define SANITIZER_INTERCEPT_FCLOSE SI_POSIX
342 #ifndef SANITIZER_INTERCEPT_DLOPEN_DLCLOSE
343 #define SANITIZER_INTERCEPT_DLOPEN_DLCLOSE \
344 (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_MAC)
345 #endif
347 #define SANITIZER_INTERCEPT_GETPASS \
348 (SI_LINUX_NOT_ANDROID || SI_MAC || SI_NETBSD)
349 #define SANITIZER_INTERCEPT_TIMERFD SI_LINUX_NOT_ANDROID
351 #define SANITIZER_INTERCEPT_MLOCKX SI_POSIX
352 #define SANITIZER_INTERCEPT_FOPENCOOKIE SI_LINUX_NOT_ANDROID
353 #define SANITIZER_INTERCEPT_SEM (SI_LINUX || SI_FREEBSD || SI_NETBSD)
354 #define SANITIZER_INTERCEPT_PTHREAD_SETCANCEL SI_POSIX
355 #define SANITIZER_INTERCEPT_MINCORE (SI_LINUX || SI_NETBSD)
356 #define SANITIZER_INTERCEPT_PROCESS_VM_READV SI_LINUX
357 #define SANITIZER_INTERCEPT_CTERMID \
358 (SI_LINUX || SI_MAC || SI_FREEBSD || SI_NETBSD)
359 #define SANITIZER_INTERCEPT_CTERMID_R (SI_MAC || SI_FREEBSD)
361 #define SANITIZER_INTERCEPTOR_HOOKS (SI_LINUX || SI_MAC || SI_WINDOWS)
362 #define SANITIZER_INTERCEPT_RECV_RECVFROM SI_POSIX
363 #define SANITIZER_INTERCEPT_SEND_SENDTO SI_POSIX
364 #define SANITIZER_INTERCEPT_EVENTFD_READ_WRITE SI_LINUX
366 #define SANITIZER_INTERCEPT_STAT \
367 (SI_FREEBSD || SI_MAC || SI_ANDROID || SI_NETBSD)
368 #define SANITIZER_INTERCEPT___XSTAT (!SANITIZER_INTERCEPT_STAT && SI_POSIX)
369 #define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID
370 #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT
371 #define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID
373 #define SANITIZER_INTERCEPT_UTMP (SI_POSIX && !SI_MAC && !SI_FREEBSD)
374 #define SANITIZER_INTERCEPT_UTMPX (SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD)
376 #define SANITIZER_INTERCEPT_GETLOADAVG \
377 (SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD || SI_NETBSD)
379 #define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO \
380 (!SI_FREEBSD && !SI_MAC && !SI_NETBSD && SI_NOT_FUCHSIA)
381 #define SANITIZER_INTERCEPT_MEMALIGN (!SI_FREEBSD && !SI_MAC && !SI_NETBSD)
382 #define SANITIZER_INTERCEPT_PVALLOC \
383 (!SI_FREEBSD && !SI_MAC && !SI_NETBSD && SI_NOT_FUCHSIA)
384 #define SANITIZER_INTERCEPT_CFREE \
385 (!SI_FREEBSD && !SI_MAC && !SI_NETBSD && SI_NOT_FUCHSIA)
386 #define SANITIZER_INTERCEPT_ALIGNED_ALLOC (!SI_MAC)
387 #define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC)
388 #define SANITIZER_INTERCEPT_MCHECK_MPROBE SI_LINUX_NOT_ANDROID
389 #define SANITIZER_INTERCEPT_WCSCAT SI_POSIX
390 #define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA)
391 #define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID
393 #endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H