aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
committerEd Schouten <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
commit11023dc647fd8f41418da90d59db138400d0f334 (patch)
tree50f0ab80515576749ef638dd0766b70a65904bfa /include
parent58aabf08b77d221489f10e274812ec60917c21a8 (diff)
downloadsrc-11023dc647fd8f41418da90d59db138400d0f334.tar.gz
src-11023dc647fd8f41418da90d59db138400d0f334.zip
Import compiler-rt r182741.vendor/compiler-rt/compiler-rt-r182741
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=251034 svn path=/vendor/compiler-rt/compiler-rt-r182741/; revision=251036; tag=vendor/compiler-rt/compiler-rt-r182741
Diffstat (limited to 'include')
-rw-r--r--include/CMakeLists.txt39
-rw-r--r--include/sanitizer/asan_interface.h139
-rw-r--r--include/sanitizer/common_interface_defs.h88
-rw-r--r--include/sanitizer/linux_syscall_hooks.h802
-rw-r--r--include/sanitizer/msan_interface.h173
5 files changed, 977 insertions, 264 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
new file mode 100644
index 000000000000..700b5326b06c
--- /dev/null
+++ b/include/CMakeLists.txt
@@ -0,0 +1,39 @@
+set(SANITIZER_HEADERS
+ sanitizer/asan_interface.h
+ sanitizer/common_interface_defs.h
+ sanitizer/linux_syscall_hooks.h
+ sanitizer/msan_interface.h)
+
+set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
+
+if(MSVC_IDE OR XCODE)
+ set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
+endif()
+
+# Copy compiler-rt headers to the build tree.
+set(out_files)
+foreach( f ${SANITIZER_HEADERS} )
+ set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
+ set( dst ${output_dir}/${f} )
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying compiler-rt's ${f}...")
+ list(APPEND out_files ${dst})
+
+ if(other_output_dir)
+ set(other_dst ${other_output_dir}/${f})
+ add_custom_command(OUTPUT ${other_dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst}
+ COMMENT "Copying compiler-rt's ${f}...")
+ list(APPEND out_files ${other_dst})
+ endif()
+endforeach( f )
+
+add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
+
+# Install sanitizer headers.
+install(FILES ${SANITIZER_HEADERS}
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+ DESTINATION ${LIBCLANG_INSTALL_PATH}/include/sanitizer)
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h
index 6afc3800f4e7..8adf3f17f24b 100644
--- a/include/sanitizer/asan_interface.h
+++ b/include/sanitizer/asan_interface.h
@@ -7,69 +7,18 @@
//
//===----------------------------------------------------------------------===//
//
-// This file is a part of AddressSanitizer, an address sanity checker.
+// This file is a part of AddressSanitizer.
//
-// This header can be included by the instrumented program to fetch
-// data (mostly allocator statistics) from ASan runtime library.
+// Public interface header.
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_ASAN_INTERFACE_H
#define SANITIZER_ASAN_INTERFACE_H
#include <sanitizer/common_interface_defs.h>
-// ----------- ATTENTION -------------
-// This header should NOT include any other headers from ASan runtime.
-// All functions in this header are extern "C" and start with __asan_.
-
-using __sanitizer::uptr;
-
+#ifdef __cplusplus
extern "C" {
- // This function should be called at the very beginning of the process,
- // before any instrumented code is executed and before any call to malloc.
- void __asan_init() SANITIZER_INTERFACE_ATTRIBUTE;
-
- // This structure describes an instrumented global variable.
- struct __asan_global {
- uptr beg; // The address of the global.
- uptr size; // The original size of the global.
- uptr size_with_redzone; // The size with the redzone.
- const char *name; // Name as a C string.
- uptr has_dynamic_init; // Non-zero if the global has dynamic initializer.
- };
-
- // These two functions should be called by the instrumented code.
- // 'globals' is an array of structures describing 'n' globals.
- void __asan_register_globals(__asan_global *globals, uptr n)
- SANITIZER_INTERFACE_ATTRIBUTE;
- void __asan_unregister_globals(__asan_global *globals, uptr n)
- SANITIZER_INTERFACE_ATTRIBUTE;
-
- // These two functions should be called before and after dynamic initializers
- // run, respectively. They should be called with parameters describing all
- // dynamically initialized globals defined in the calling TU.
- void __asan_before_dynamic_init(uptr first_addr, uptr last_addr)
- SANITIZER_INTERFACE_ATTRIBUTE;
- void __asan_after_dynamic_init()
- SANITIZER_INTERFACE_ATTRIBUTE;
-
- // These two functions are used by the instrumented code in the
- // use-after-return mode. __asan_stack_malloc allocates size bytes of
- // fake stack and __asan_stack_free poisons it. real_stack is a pointer to
- // the real stack region.
- uptr __asan_stack_malloc(uptr size, uptr real_stack)
- SANITIZER_INTERFACE_ATTRIBUTE;
- void __asan_stack_free(uptr ptr, uptr size, uptr real_stack)
- SANITIZER_INTERFACE_ATTRIBUTE;
-
- // These two functions are used by instrumented code in the
- // use-after-scope mode. They mark memory for local variables as
- // unaddressable when they leave scope and addressable before the
- // function exits.
- void __asan_poison_stack_memory(uptr addr, uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
- void __asan_unpoison_stack_memory(uptr addr, uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
-
+#endif
// Marks memory region [addr, addr+size) as unaddressable.
// This memory must be previously allocated by the user program. Accessing
// addresses in this region from instrumented code is forbidden until
@@ -78,8 +27,7 @@ extern "C" {
// to ASan alignment restrictions.
// Method is NOT thread-safe in the sense that no two threads can
// (un)poison memory in the same memory region simultaneously.
- void __asan_poison_memory_region(void const volatile *addr, uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_poison_memory_region(void const volatile *addr, size_t size);
// Marks memory region [addr, addr+size) as addressable.
// This memory must be previously allocated by the user program. Accessing
// addresses in this region is allowed until this region is poisoned again.
@@ -87,15 +35,10 @@ extern "C" {
// ASan alignment restrictions.
// Method is NOT thread-safe in the sense that no two threads can
// (un)poison memory in the same memory region simultaneously.
- void __asan_unpoison_memory_region(void const volatile *addr, uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
-
- // Performs cleanup before a NoReturn function. Must be called before things
- // like _exit and execl to avoid false positives on stack.
- void __asan_handle_no_return() SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
-// User code should use macro instead of functions.
-#if __has_feature(address_sanitizer)
+// User code should use macros instead of functions.
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#define ASAN_POISON_MEMORY_REGION(addr, size) \
__asan_poison_memory_region((addr), (size))
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
@@ -109,104 +52,86 @@ extern "C" {
// Returns true iff addr is poisoned (i.e. 1-byte read/write access to this
// address will result in error report from AddressSanitizer).
- bool __asan_address_is_poisoned(void const volatile *addr)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ bool __asan_address_is_poisoned(void const volatile *addr);
// If at least on byte in [beg, beg+size) is poisoned, return the address
// of the first such byte. Otherwise return 0.
- uptr __asan_region_is_poisoned(uptr beg, uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void *__asan_region_is_poisoned(void *beg, size_t size);
// Print the description of addr (useful when debugging in gdb).
- void __asan_describe_address(uptr addr)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_describe_address(void *addr);
// This is an internal function that is called to report an error.
// However it is still a part of the interface because users may want to
// set a breakpoint on this function in a debugger.
- void __asan_report_error(uptr pc, uptr bp, uptr sp,
- uptr addr, bool is_write, uptr access_size)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_report_error(void *pc, void *bp, void *sp,
+ void *addr, bool is_write, size_t access_size);
// Sets the exit code to use when reporting an error.
// Returns the old value.
- int __asan_set_error_exit_code(int exit_code)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ int __asan_set_error_exit_code(int exit_code);
// Sets the callback to be called right before death on error.
// Passing 0 will unset the callback.
- void __asan_set_death_callback(void (*callback)(void))
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_set_death_callback(void (*callback)(void));
- void __asan_set_error_report_callback(void (*callback)(const char*))
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_set_error_report_callback(void (*callback)(const char*));
// User may provide function that would be called right when ASan detects
// an error. This can be used to notice cases when ASan detects an error, but
// the program crashes before ASan report is printed.
- /* OPTIONAL */ void __asan_on_error()
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_on_error();
// User may provide its own implementation for symbolization function.
// It should print the description of instruction at address "pc" to
// "out_buffer". Description should be at most "out_size" bytes long.
// User-specified function should return true if symbolization was
// successful.
- /* OPTIONAL */ bool __asan_symbolize(const void *pc, char *out_buffer,
- int out_size)
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+ bool __asan_symbolize(const void *pc, char *out_buffer,
+ int out_size);
// Returns the estimated number of bytes that will be reserved by allocator
// for request of "size" bytes. If ASan allocator can't allocate that much
// memory, returns the maximal possible allocation size, otherwise returns
// "size".
- uptr __asan_get_estimated_allocated_size(uptr size)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_estimated_allocated_size(size_t size);
// Returns true if p was returned by the ASan allocator and
// is not yet freed.
- bool __asan_get_ownership(const void *p)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ bool __asan_get_ownership(const void *p);
// Returns the number of bytes reserved for the pointer p.
// Requires (get_ownership(p) == true) or (p == 0).
- uptr __asan_get_allocated_size(const void *p)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_allocated_size(const void *p);
// Number of bytes, allocated and not yet freed by the application.
- uptr __asan_get_current_allocated_bytes()
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_current_allocated_bytes();
// Number of bytes, mmaped by asan allocator to fulfill allocation requests.
// Generally, for request of X bytes, allocator can reserve and add to free
// lists a large number of chunks of size X to use them for future requests.
// All these chunks count toward the heap size. Currently, allocator never
// releases memory to OS (instead, it just puts freed chunks to free lists).
- uptr __asan_get_heap_size()
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_heap_size();
// Number of bytes, mmaped by asan allocator, which can be used to fulfill
// allocation requests. When a user program frees memory chunk, it can first
// fall into quarantine and will count toward __asan_get_free_bytes() later.
- uptr __asan_get_free_bytes()
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_free_bytes();
// Number of bytes in unmapped pages, that are released to OS. Currently,
// always returns 0.
- uptr __asan_get_unmapped_bytes()
- SANITIZER_INTERFACE_ATTRIBUTE;
+ size_t __asan_get_unmapped_bytes();
// Prints accumulated stats to stderr. Used for debugging.
- void __asan_print_accumulated_stats()
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_print_accumulated_stats();
// This function may be optionally provided by user and should return
// a string containing ASan runtime options. See asan_flags.h for details.
- /* OPTIONAL */ const char* __asan_default_options()
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+ const char* __asan_default_options();
// Malloc hooks that may be optionally provided by user.
// __asan_malloc_hook(ptr, size) is called immediately after
// allocation of "size" bytes, which returned "ptr".
// __asan_free_hook(ptr) is called immediately before
// deallocation of "ptr".
- /* OPTIONAL */ void __asan_malloc_hook(void *ptr, uptr size)
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
- /* OPTIONAL */ void __asan_free_hook(void *ptr)
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+ void __asan_malloc_hook(void *ptr, size_t size);
+ void __asan_free_hook(void *ptr);
+#ifdef __cplusplus
} // extern "C"
+#endif
#endif // SANITIZER_ASAN_INTERFACE_H
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h
index 9d8fa5582b67..31d0dea5484b 100644
--- a/include/sanitizer/common_interface_defs.h
+++ b/include/sanitizer/common_interface_defs.h
@@ -7,86 +7,52 @@
//
//===----------------------------------------------------------------------===//
//
-// This file is shared between AddressSanitizer and ThreadSanitizer.
-// It contains basic macro and types.
-// NOTE: This file may be included into user code.
+// Common part of the public sanitizer interface.
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_COMMON_INTERFACE_DEFS_H
#define SANITIZER_COMMON_INTERFACE_DEFS_H
-// ----------- ATTENTION -------------
-// This header should NOT include any other headers to avoid portability issues.
+#include <stddef.h>
+#include <stdint.h>
-#if defined(_WIN32)
-// FIXME find out what we need on Windows. __declspec(dllexport) ?
-# define SANITIZER_INTERFACE_ATTRIBUTE
-# define SANITIZER_WEAK_ATTRIBUTE
-#elif defined(SANITIZER_GO)
-# define SANITIZER_INTERFACE_ATTRIBUTE
-# define SANITIZER_WEAK_ATTRIBUTE
-#else
-# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
-# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
-#endif
-
-#ifdef __linux__
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 1
-#else
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 0
-#endif
-
-// __has_feature
+// GCC does not understand __has_feature.
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
-// For portability reasons we do not include stddef.h, stdint.h or any other
-// system header, but we do need some basic types that are not defined
-// in a portable way by the language itself.
-namespace __sanitizer {
-
-#if defined(_WIN64)
-// 64-bit Windows uses LLP64 data model.
-typedef unsigned long long uptr; // NOLINT
-typedef signed long long sptr; // NOLINT
-#else
-typedef unsigned long uptr; // NOLINT
-typedef signed long sptr; // NOLINT
-#endif // defined(_WIN64)
-#if defined(__x86_64__)
-// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use
-// 64-bit pointer to unwind stack frame.
-typedef unsigned long long uhwptr; // NOLINT
-#else
-typedef uptr uhwptr; // NOLINT
-#endif
-typedef unsigned char u8;
-typedef unsigned short u16; // NOLINT
-typedef unsigned int u32;
-typedef unsigned long long u64; // NOLINT
-typedef signed char s8;
-typedef signed short s16; // NOLINT
-typedef signed int s32;
-typedef signed long long s64; // NOLINT
-
-} // namespace __sanitizer
-
+#ifdef __cplusplus
extern "C" {
+#endif
// Tell the tools to write their reports to "path.<pid>" instead of stderr.
- void __sanitizer_set_report_path(const char *path)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __sanitizer_set_report_path(const char *path);
// Tell the tools to write their reports to given file descriptor instead of
// stderr.
- void __sanitizer_set_report_fd(int fd)
- SANITIZER_INTERFACE_ATTRIBUTE;
+ void __sanitizer_set_report_fd(int fd);
// Notify the tools that the sandbox is going to be turned on. The reserved
// parameter will be used in the future to hold a structure with functions
// that the tools may call to bypass the sandbox.
- void __sanitizer_sandbox_on_notify(void *reserved)
- SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+ void __sanitizer_sandbox_on_notify(void *reserved);
+
+ // This function is called by the tool when it has just finished reporting
+ // an error. 'error_summary' is a one-line string that summarizes
+ // the error message. This function can be overridden by the client.
+ void __sanitizer_report_error_summary(const char *error_summary);
+
+ // Some of the sanitizers (e.g. asan/tsan) may miss bugs that happen
+ // in unaligned loads/stores. In order to find such bugs reliably one needs
+ // to replace plain unaligned loads/stores with these calls.
+ uint16_t __sanitizer_unaligned_load16(const void *p);
+ uint32_t __sanitizer_unaligned_load32(const void *p);
+ uint64_t __sanitizer_unaligned_load64(const void *p);
+ void __sanitizer_unaligned_store16(void *p, uint16_t x);
+ void __sanitizer_unaligned_store32(void *p, uint32_t x);
+ void __sanitizer_unaligned_store64(void *p, uint64_t x);
+
+#ifdef __cplusplus
} // extern "C"
+#endif
#endif // SANITIZER_COMMON_INTERFACE_DEFS_H
diff --git a/include/sanitizer/linux_syscall_hooks.h b/include/sanitizer/linux_syscall_hooks.h
new file mode 100644
index 000000000000..894d5c2bebff
--- /dev/null
+++ b/include/sanitizer/linux_syscall_hooks.h
@@ -0,0 +1,802 @@
+//===-- linux_syscall_hooks.h ---------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of public sanitizer interface.
+//
+// System call handlers.
+//
+// Interface methods declared in this header implement pre- and post- syscall
+// actions for the active sanitizer.
+// Usage:
+// __sanitizer_syscall_pre_getfoo(...args...);
+// int res = syscall(__NR_getfoo, ...args...);
+// __sanitizer_syscall_post_getfoo(res, ...args...);
+//===----------------------------------------------------------------------===//
+#ifndef SANITIZER_LINUX_SYSCALL_HOOKS_H
+#define SANITIZER_LINUX_SYSCALL_HOOKS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void __sanitizer_syscall_pre_rt_sigpending(void *p, size_t s);
+void __sanitizer_syscall_pre_getdents(int fd, void *dirp, int count);
+void __sanitizer_syscall_pre_getdents64(int fd, void *dirp, int count);
+void __sanitizer_syscall_pre_recvmsg(int sockfd, void *msg, int flags);
+void __sanitizer_syscall_pre_wait4(int pid, int *status, int options, void *r);
+void __sanitizer_syscall_pre_waitpid(int pid, int *status, int options);
+
+void __sanitizer_syscall_post_rt_sigpending(long res, void *p, size_t s);
+void __sanitizer_syscall_post_getdents(long res, int fd, void *dirp, int count);
+void __sanitizer_syscall_post_getdents64(long res, int fd, void *dirp,
+ int count);
+void __sanitizer_syscall_post_recvmsg(long res, int sockfd, void *msg,
+ int flags);
+void __sanitizer_syscall_post_wait4(long res, int pid, int *status, int options,
+ void *r);
+void __sanitizer_syscall_post_waitpid(long res, int pid, int *status,
+ int options);
+
+// And now a few syscalls we don't handle yet.
+
+#define __sanitizer_syscall_pre_accept(...)
+#define __sanitizer_syscall_pre_accept4(...)
+#define __sanitizer_syscall_pre_access(...)
+#define __sanitizer_syscall_pre_acct(...)
+#define __sanitizer_syscall_pre_add_key(...)
+#define __sanitizer_syscall_pre_adjtimex(...)
+#define __sanitizer_syscall_pre_afs_syscall(...)
+#define __sanitizer_syscall_pre_alarm(...)
+#define __sanitizer_syscall_pre_arch_prctl(...)
+#define __sanitizer_syscall_pre_bdflush(...)
+#define __sanitizer_syscall_pre_bind(...)
+#define __sanitizer_syscall_pre_break(...)
+#define __sanitizer_syscall_pre_brk(...)
+#define __sanitizer_syscall_pre_capget(...)
+#define __sanitizer_syscall_pre_capset(...)
+#define __sanitizer_syscall_pre_chdir(...)
+#define __sanitizer_syscall_pre_chmod(...)
+#define __sanitizer_syscall_pre_chown(...)
+#define __sanitizer_syscall_pre_chown32(...)
+#define __sanitizer_syscall_pre_chroot(...)
+#define __sanitizer_syscall_pre_clock_adjtime(...)
+#define __sanitizer_syscall_pre_clock_getres(...)
+#define __sanitizer_syscall_pre_clock_gettime(...)
+#define __sanitizer_syscall_pre_clock_nanosleep(...)
+#define __sanitizer_syscall_pre_clock_settime(...)
+#define __sanitizer_syscall_pre_clone(...)
+#define __sanitizer_syscall_pre_close(...)
+#define __sanitizer_syscall_pre_connect(...)
+#define __sanitizer_syscall_pre_creat(...)
+#define __sanitizer_syscall_pre_create_module(...)
+#define __sanitizer_syscall_pre_delete_module(...)
+#define __sanitizer_syscall_pre_dup(...)
+#define __sanitizer_syscall_pre_dup2(...)
+#define __sanitizer_syscall_pre_dup3(...)
+#define __sanitizer_syscall_pre_epoll_create(...)
+#define __sanitizer_syscall_pre_epoll_create1(...)
+#define __sanitizer_syscall_pre_epoll_ctl(...)
+#define __sanitizer_syscall_pre_epoll_ctl_old(...)
+#define __sanitizer_syscall_pre_epoll_pwait(...)
+#define __sanitizer_syscall_pre_epoll_wait(...)
+#define __sanitizer_syscall_pre_epoll_wait_old(...)
+#define __sanitizer_syscall_pre_eventfd(...)
+#define __sanitizer_syscall_pre_eventfd2(...)
+#define __sanitizer_syscall_pre_execve(...)
+#define __sanitizer_syscall_pre_exit(...)
+#define __sanitizer_syscall_pre_exit_group(...)
+#define __sanitizer_syscall_pre_faccessat(...)
+#define __sanitizer_syscall_pre_fadvise64(...)
+#define __sanitizer_syscall_pre_fadvise64_64(...)
+#define __sanitizer_syscall_pre_fallocate(...)
+#define __sanitizer_syscall_pre_fanotify_init(...)
+#define __sanitizer_syscall_pre_fanotify_mark(...)
+#define __sanitizer_syscall_pre_fchdir(...)
+#define __sanitizer_syscall_pre_fchmod(...)
+#define __sanitizer_syscall_pre_fchmodat(...)
+#define __sanitizer_syscall_pre_fchown(...)
+#define __sanitizer_syscall_pre_fchown32(...)
+#define __sanitizer_syscall_pre_fchownat(...)
+#define __sanitizer_syscall_pre_fcntl(...)
+#define __sanitizer_syscall_pre_fcntl64(...)
+#define __sanitizer_syscall_pre_fdatasync(...)
+#define __sanitizer_syscall_pre_fgetxattr(...)
+#define __sanitizer_syscall_pre_flistxattr(...)
+#define __sanitizer_syscall_pre_flock(...)
+#define __sanitizer_syscall_pre_fork(...)
+#define __sanitizer_syscall_pre_fremovexattr(...)
+#define __sanitizer_syscall_pre_fsetxattr(...)
+#define __sanitizer_syscall_pre_fstat(...)
+#define __sanitizer_syscall_pre_fstat64(...)
+#define __sanitizer_syscall_pre_fstatat64(...)
+#define __sanitizer_syscall_pre_fstatfs(...)
+#define __sanitizer_syscall_pre_fstatfs64(...)
+#define __sanitizer_syscall_pre_fsync(...)
+#define __sanitizer_syscall_pre_ftime(...)
+#define __sanitizer_syscall_pre_ftruncate(...)
+#define __sanitizer_syscall_pre_ftruncate64(...)
+#define __sanitizer_syscall_pre_futex(...)
+#define __sanitizer_syscall_pre_futimesat(...)
+#define __sanitizer_syscall_pre_getcpu(...)
+#define __sanitizer_syscall_pre_getcwd(...)
+#define __sanitizer_syscall_pre_getegid(...)
+#define __sanitizer_syscall_pre_getegid32(...)
+#define __sanitizer_syscall_pre_geteuid(...)
+#define __sanitizer_syscall_pre_geteuid32(...)
+#define __sanitizer_syscall_pre_getgid(...)
+#define __sanitizer_syscall_pre_getgid32(...)
+#define __sanitizer_syscall_pre_getgroups(...)
+#define __sanitizer_syscall_pre_getgroups32(...)
+#define __sanitizer_syscall_pre_getitimer(...)
+#define __sanitizer_syscall_pre_get_kernel_syms(...)
+#define __sanitizer_syscall_pre_get_mempolicy(...)
+#define __sanitizer_syscall_pre_getpeername(...)
+#define __sanitizer_syscall_pre_getpgid(...)
+#define __sanitizer_syscall_pre_getpgrp(...)
+#define __sanitizer_syscall_pre_getpid(...)
+#define __sanitizer_syscall_pre_getpmsg(...)
+#define __sanitizer_syscall_pre_getppid(...)
+#define __sanitizer_syscall_pre_getpriority(...)
+#define __sanitizer_syscall_pre_getresgid(...)
+#define __sanitizer_syscall_pre_getresgid32(...)
+#define __sanitizer_syscall_pre_getresuid(...)
+#define __sanitizer_syscall_pre_getresuid32(...)
+#define __sanitizer_syscall_pre_getrlimit(...)
+#define __sanitizer_syscall_pre_get_robust_list(...)
+#define __sanitizer_syscall_pre_getrusage(...)
+#define __sanitizer_syscall_pre_getsid(...)
+#define __sanitizer_syscall_pre_getsockname(...)
+#define __sanitizer_syscall_pre_getsockopt(...)
+#define __sanitizer_syscall_pre_get_thread_area(...)
+#define __sanitizer_syscall_pre_gettid(...)
+#define __sanitizer_syscall_pre_gettimeofday(...)
+#define __sanitizer_syscall_pre_getuid(...)
+#define __sanitizer_syscall_pre_getuid32(...)
+#define __sanitizer_syscall_pre_getxattr(...)
+#define __sanitizer_syscall_pre_gtty(...)
+#define __sanitizer_syscall_pre_idle(...)
+#define __sanitizer_syscall_pre_init_module(...)
+#define __sanitizer_syscall_pre_inotify_add_watch(...)
+#define __sanitizer_syscall_pre_inotify_init(...)
+#define __sanitizer_syscall_pre_inotify_init1(...)
+#define __sanitizer_syscall_pre_inotify_rm_watch(...)
+#define __sanitizer_syscall_pre_io_cancel(...)
+#define __sanitizer_syscall_pre_ioctl(...)
+#define __sanitizer_syscall_pre_io_destroy(...)
+#define __sanitizer_syscall_pre_io_getevents(...)
+#define __sanitizer_syscall_pre_ioperm(...)
+#define __sanitizer_syscall_pre_iopl(...)
+#define __sanitizer_syscall_pre_ioprio_get(...)
+#define __sanitizer_syscall_pre_ioprio_set(...)
+#define __sanitizer_syscall_pre_io_setup(...)
+#define __sanitizer_syscall_pre_io_submit(...)
+#define __sanitizer_syscall_pre_ipc(...)
+#define __sanitizer_syscall_pre_kexec_load(...)
+#define __sanitizer_syscall_pre_keyctl(...)
+#define __sanitizer_syscall_pre_kill(...)
+#define __sanitizer_syscall_pre_lchown(...)
+#define __sanitizer_syscall_pre_lchown32(...)
+#define __sanitizer_syscall_pre_lgetxattr(...)
+#define __sanitizer_syscall_pre_link(...)
+#define __sanitizer_syscall_pre_linkat(...)
+#define __sanitizer_syscall_pre_listen(...)
+#define __sanitizer_syscall_pre_listxattr(...)
+#define __sanitizer_syscall_pre_llistxattr(...)
+#define __sanitizer_syscall_pre__llseek(...)
+#define __sanitizer_syscall_pre_lock(...)
+#define __sanitizer_syscall_pre_lookup_dcookie(...)
+#define __sanitizer_syscall_pre_lremovexattr(...)
+#define __sanitizer_syscall_pre_lseek(...)
+#define __sanitizer_syscall_pre_lsetxattr(...)
+#define __sanitizer_syscall_pre_lstat(...)
+#define __sanitizer_syscall_pre_lstat64(...)
+#define __sanitizer_syscall_pre_madvise(...)
+#define __sanitizer_syscall_pre_madvise1(...)
+#define __sanitizer_syscall_pre_mbind(...)
+#define __sanitizer_syscall_pre_migrate_pages(...)
+#define __sanitizer_syscall_pre_mincore(...)
+#define __sanitizer_syscall_pre_mkdir(...)
+#define __sanitizer_syscall_pre_mkdirat(...)
+#define __sanitizer_syscall_pre_mknod(...)
+#define __sanitizer_syscall_pre_mknodat(...)
+#define __sanitizer_syscall_pre_mlock(...)
+#define __sanitizer_syscall_pre_mlockall(...)
+#define __sanitizer_syscall_pre_mmap(...)
+#define __sanitizer_syscall_pre_mmap2(...)
+#define __sanitizer_syscall_pre_modify_ldt(...)
+#define __sanitizer_syscall_pre_mount(...)
+#define __sanitizer_syscall_pre_move_pages(...)
+#define __sanitizer_syscall_pre_mprotect(...)
+#define __sanitizer_syscall_pre_mpx(...)
+#define __sanitizer_syscall_pre_mq_getsetattr(...)
+#define __sanitizer_syscall_pre_mq_notify(...)
+#define __sanitizer_syscall_pre_mq_open(...)
+#define __sanitizer_syscall_pre_mq_timedreceive(...)
+#define __sanitizer_syscall_pre_mq_timedsend(...)
+#define __sanitizer_syscall_pre_mq_unlink(...)
+#define __sanitizer_syscall_pre_mremap(...)
+#define __sanitizer_syscall_pre_msgctl(...)
+#define __sanitizer_syscall_pre_msgget(...)
+#define __sanitizer_syscall_pre_msgrcv(...)
+#define __sanitizer_syscall_pre_msgsnd(...)
+#define __sanitizer_syscall_pre_msync(...)
+#define __sanitizer_syscall_pre_munlock(...)
+#define __sanitizer_syscall_pre_munlockall(...)
+#define __sanitizer_syscall_pre_munmap(...)
+#define __sanitizer_syscall_pre_name_to_handle_at(...)
+#define __sanitizer_syscall_pre_nanosleep(...)
+#define __sanitizer_syscall_pre_newfstatat(...)
+#define __sanitizer_syscall_pre__newselect(...)
+#define __sanitizer_syscall_pre_nfsservctl(...)
+#define __sanitizer_syscall_pre_nice(...)
+#define __sanitizer_syscall_pre_oldfstat(...)
+#define __sanitizer_syscall_pre_oldlstat(...)
+#define __sanitizer_syscall_pre_oldolduname(...)
+#define __sanitizer_syscall_pre_oldstat(...)
+#define __sanitizer_syscall_pre_olduname(...)
+#define __sanitizer_syscall_pre_open(...)
+#define __sanitizer_syscall_pre_openat(...)
+#define __sanitizer_syscall_pre_open_by_handle_at(...)
+#define __sanitizer_syscall_pre_pause(...)
+#define __sanitizer_syscall_pre_perf_event_open(...)
+#define __sanitizer_syscall_pre_personality(...)
+#define __sanitizer_syscall_pre_pipe(...)
+#define __sanitizer_syscall_pre_pipe2(...)
+#define __sanitizer_syscall_pre_pivot_root(...)
+#define __sanitizer_syscall_pre_poll(...)
+#define __sanitizer_syscall_pre_ppoll(...)
+#define __sanitizer_syscall_pre_prctl(...)
+#define __sanitizer_syscall_pre_pread64(...)
+#define __sanitizer_syscall_pre_preadv(...)
+#define __sanitizer_syscall_pre_prlimit64(...)
+#define __sanitizer_syscall_pre_process_vm_readv(...)
+#define __sanitizer_syscall_pre_process_vm_writev(...)
+#define __sanitizer_syscall_pre_prof(...)
+#define __sanitizer_syscall_pre_profil(...)
+#define __sanitizer_syscall_pre_pselect6(...)
+#define __sanitizer_syscall_pre_ptrace(...)
+#define __sanitizer_syscall_pre_putpmsg(...)
+#define __sanitizer_syscall_pre_pwrite64(...)
+#define __sanitizer_syscall_pre_pwritev(...)
+#define __sanitizer_syscall_pre_query_module(...)
+#define __sanitizer_syscall_pre_quotactl(...)
+#define __sanitizer_syscall_pre_read(...)
+#define __sanitizer_syscall_pre_readahead(...)
+#define __sanitizer_syscall_pre_readdir(...)
+#define __sanitizer_syscall_pre_readlink(...)
+#define __sanitizer_syscall_pre_readlinkat(...)
+#define __sanitizer_syscall_pre_readv(...)
+#define __sanitizer_syscall_pre_reboot(...)
+#define __sanitizer_syscall_pre_recvfrom(...)
+#define __sanitizer_syscall_pre_recvmmsg(...)
+#define __sanitizer_syscall_pre_remap_file_pages(...)
+#define __sanitizer_syscall_pre_removexattr(...)
+#define __sanitizer_syscall_pre_rename(...)
+#define __sanitizer_syscall_pre_renameat(...)
+#define __sanitizer_syscall_pre_request_key(...)
+#define __sanitizer_syscall_pre_restart_syscall(...)
+#define __sanitizer_syscall_pre_rmdir(...)
+#define __sanitizer_syscall_pre_rt_sigaction(...)
+#define __sanitizer_syscall_pre_rt_sigprocmask(...)
+#define __sanitizer_syscall_pre_rt_sigqueueinfo(...)
+#define __sanitizer_syscall_pre_rt_sigreturn(...)
+#define __sanitizer_syscall_pre_rt_sigsuspend(...)
+#define __sanitizer_syscall_pre_rt_sigtimedwait(...)
+#define __sanitizer_syscall_pre_rt_tgsigqueueinfo(...)
+#define __sanitizer_syscall_pre_sched_getaffinity(...)
+#define __sanitizer_syscall_pre_sched_getparam(...)
+#define __sanitizer_syscall_pre_sched_get_priority_max(...)
+#define __sanitizer_syscall_pre_sched_get_priority_min(...)
+#define __sanitizer_syscall_pre_sched_getscheduler(...)
+#define __sanitizer_syscall_pre_sched_rr_get_interval(...)
+#define __sanitizer_syscall_pre_sched_setaffinity(...)
+#define __sanitizer_syscall_pre_sched_setparam(...)
+#define __sanitizer_syscall_pre_sched_setscheduler(...)
+#define __sanitizer_syscall_pre_sched_yield(...)
+#define __sanitizer_syscall_pre_security(...)
+#define __sanitizer_syscall_pre_select(...)
+#define __sanitizer_syscall_pre_semctl(...)
+#define __sanitizer_syscall_pre_semget(...)
+#define __sanitizer_syscall_pre_semop(...)
+#define __sanitizer_syscall_pre_semtimedop(...)
+#define __sanitizer_syscall_pre_sendfile(...)
+#define __sanitizer_syscall_pre_sendfile64(...)
+#define __sanitizer_syscall_pre_sendmmsg(...)
+#define __sanitizer_syscall_pre_sendmsg(...)
+#define __sanitizer_syscall_pre_sendto(...)
+#define __sanitizer_syscall_pre_setdomainname(...)
+#define __sanitizer_syscall_pre_setfsgid(...)
+#define __sanitizer_syscall_pre_setfsgid32(...)
+#define __sanitizer_syscall_pre_setfsuid(...)
+#define __sanitizer_syscall_pre_setfsuid32(...)
+#define __sanitizer_syscall_pre_setgid(...)
+#define __sanitizer_syscall_pre_setgid32(...)
+#define __sanitizer_syscall_pre_setgroups(...)
+#define __sanitizer_syscall_pre_setgroups32(...)
+#define __sanitizer_syscall_pre_sethostname(...)
+#define __sanitizer_syscall_pre_setitimer(...)
+#define __sanitizer_syscall_pre_set_mempolicy(...)
+#define __sanitizer_syscall_pre_setns(...)
+#define __sanitizer_syscall_pre_setpgid(...)
+#define __sanitizer_syscall_pre_setpriority(...)
+#define __sanitizer_syscall_pre_setregid(...)
+#define __sanitizer_syscall_pre_setregid32(...)
+#define __sanitizer_syscall_pre_setresgid(...)
+#define __sanitizer_syscall_pre_setresgid32(...)
+#define __sanitizer_syscall_pre_setresuid(...)
+#define __sanitizer_syscall_pre_setresuid32(...)
+#define __sanitizer_syscall_pre_setreuid(...)
+#define __sanitizer_syscall_pre_setreuid32(...)
+#define __sanitizer_syscall_pre_setrlimit(...)
+#define __sanitizer_syscall_pre_set_robust_list(...)
+#define __sanitizer_syscall_pre_setsid(...)
+#define __sanitizer_syscall_pre_setsockopt(...)
+#define __sanitizer_syscall_pre_set_thread_area(...)
+#define __sanitizer_syscall_pre_set_tid_address(...)
+#define __sanitizer_syscall_pre_settimeofday(...)
+#define __sanitizer_syscall_pre_setuid(...)
+#define __sanitizer_syscall_pre_setuid32(...)
+#define __sanitizer_syscall_pre_setxattr(...)
+#define __sanitizer_syscall_pre_sgetmask(...)
+#define __sanitizer_syscall_pre_shmat(...)
+#define __sanitizer_syscall_pre_shmctl(...)
+#define __sanitizer_syscall_pre_shmdt(...)
+#define __sanitizer_syscall_pre_shmget(...)
+#define __sanitizer_syscall_pre_shutdown(...)
+#define __sanitizer_syscall_pre_sigaction(...)
+#define __sanitizer_syscall_pre_sigaltstack(...)
+#define __sanitizer_syscall_pre_signal(...)
+#define __sanitizer_syscall_pre_signalfd(...)
+#define __sanitizer_syscall_pre_signalfd4(...)
+#define __sanitizer_syscall_pre_sigpending(...)
+#define __sanitizer_syscall_pre_sigprocmask(...)
+#define __sanitizer_syscall_pre_sigreturn(...)
+#define __sanitizer_syscall_pre_sigsuspend(...)
+#define __sanitizer_syscall_pre_socket(...)
+#define __sanitizer_syscall_pre_socketcall(...)
+#define __sanitizer_syscall_pre_socketpair(...)
+#define __sanitizer_syscall_pre_splice(...)
+#define __sanitizer_syscall_pre_ssetmask(...)
+#define __sanitizer_syscall_pre_stat(...)
+#define __sanitizer_syscall_pre_stat64(...)
+#define __sanitizer_syscall_pre_statfs(...)
+#define __sanitizer_syscall_pre_statfs64(...)
+#define __sanitizer_syscall_pre_stime(...)
+#define __sanitizer_syscall_pre_stty(...)
+#define __sanitizer_syscall_pre_swapoff(...)
+#define __sanitizer_syscall_pre_swapon(...)
+#define __sanitizer_syscall_pre_symlink(...)
+#define __sanitizer_syscall_pre_symlinkat(...)
+#define __sanitizer_syscall_pre_sync(...)
+#define __sanitizer_syscall_pre_sync_file_range(...)
+#define __sanitizer_syscall_pre_syncfs(...)
+#define __sanitizer_syscall_pre__sysctl(...)
+#define __sanitizer_syscall_pre_sysfs(...)
+#define __sanitizer_syscall_pre_sysinfo(...)
+#define __sanitizer_syscall_pre_syslog(...)
+#define __sanitizer_syscall_pre_tee(...)
+#define __sanitizer_syscall_pre_tgkill(...)
+#define __sanitizer_syscall_pre_time(...)
+#define __sanitizer_syscall_pre_timer_create(...)
+#define __sanitizer_syscall_pre_timer_delete(...)
+#define __sanitizer_syscall_pre_timerfd_create(...)
+#define __sanitizer_syscall_pre_timerfd_gettime(...)
+#define __sanitizer_syscall_pre_timerfd_settime(...)
+#define __sanitizer_syscall_pre_timer_getoverrun(...)
+#define __sanitizer_syscall_pre_timer_gettime(...)
+#define __sanitizer_syscall_pre_timer_settime(...)
+#define __sanitizer_syscall_pre_times(...)
+#define __sanitizer_syscall_pre_tkill(...)
+#define __sanitizer_syscall_pre_truncate(...)
+#define __sanitizer_syscall_pre_truncate64(...)
+#define __sanitizer_syscall_pre_tuxcall(...)
+#define __sanitizer_syscall_pre_ugetrlimit(...)
+#define __sanitizer_syscall_pre_ulimit(...)
+#define __sanitizer_syscall_pre_umask(...)
+#define __sanitizer_syscall_pre_umount(...)
+#define __sanitizer_syscall_pre_umount2(...)
+#define __sanitizer_syscall_pre_uname(...)
+#define __sanitizer_syscall_pre_unlink(...)
+#define __sanitizer_syscall_pre_unlinkat(...)
+#define __sanitizer_syscall_pre_unshare(...)
+#define __sanitizer_syscall_pre_uselib(...)
+#define __sanitizer_syscall_pre_ustat(...)
+#define __sanitizer_syscall_pre_utime(...)
+#define __sanitizer_syscall_pre_utimensat(...)
+#define __sanitizer_syscall_pre_utimes(...)
+#define __sanitizer_syscall_pre_vfork(...)
+#define __sanitizer_syscall_pre_vhangup(...)
+#define __sanitizer_syscall_pre_vm86(...)
+#define __sanitizer_syscall_pre_vm86old(...)
+#define __sanitizer_syscall_pre_vmsplice(...)
+#define __sanitizer_syscall_pre_vserver(...)
+#define __sanitizer_syscall_pre_waitid(...)
+#define __sanitizer_syscall_pre_write(...)
+#define __sanitizer_syscall_pre_writev(...)
+
+#define __sanitizer_syscall_post_accept4(res, ...)
+#define __sanitizer_syscall_post_accept(res, ...)
+#define __sanitizer_syscall_post_access(res, ...)
+#define __sanitizer_syscall_post_acct(res, ...)
+#define __sanitizer_syscall_post_add_key(res, ...)
+#define __sanitizer_syscall_post_adjtimex(res, ...)
+#define __sanitizer_syscall_post_afs_syscall(res, ...)
+#define __sanitizer_syscall_post_alarm(res, ...)
+#define __sanitizer_syscall_post_arch_prctl(res, ...)
+#define __sanitizer_syscall_post_bdflush(res, ...)
+#define __sanitizer_syscall_post_bind(res, ...)
+#define __sanitizer_syscall_post_break(res, ...)
+#define __sanitizer_syscall_post_brk(res, ...)
+#define __sanitizer_syscall_post_capget(res, ...)
+#define __sanitizer_syscall_post_capset(res, ...)
+#define __sanitizer_syscall_post_chdir(res, ...)
+#define __sanitizer_syscall_post_chmod(res, ...)
+#define __sanitizer_syscall_post_chown32(res, ...)
+#define __sanitizer_syscall_post_chown(res, ...)
+#define __sanitizer_syscall_post_chroot(res, ...)
+#define __sanitizer_syscall_post_clock_adjtime(res, ...)
+#define __sanitizer_syscall_post_clock_getres(res, ...)
+#define __sanitizer_syscall_post_clock_gettime(res, ...)
+#define __sanitizer_syscall_post_clock_nanosleep(res, ...)
+#define __sanitizer_syscall_post_clock_settime(res, ...)
+#define __sanitizer_syscall_post_clone(res, ...)
+#define __sanitizer_syscall_post_close(res, ...)
+#define __sanitizer_syscall_post_connect(res, ...)
+#define __sanitizer_syscall_post_create_module(res, ...)
+#define __sanitizer_syscall_post_creat(res, ...)
+#define __sanitizer_syscall_post_delete_module(res, ...)
+#define __sanitizer_syscall_post_dup2(res, ...)
+#define __sanitizer_syscall_post_dup3(res, ...)
+#define __sanitizer_syscall_post_dup(res, ...)
+#define __sanitizer_syscall_post_epoll_create1(res, ...)
+#define __sanitizer_syscall_post_epoll_create(res, ...)
+#define __sanitizer_syscall_post_epoll_ctl_old(res, ...)
+#define __sanitizer_syscall_post_epoll_ctl(res, ...)
+#define __sanitizer_syscall_post_epoll_pwait(res, ...)
+#define __sanitizer_syscall_post_epoll_wait_old(res, ...)
+#define __sanitizer_syscall_post_epoll_wait(res, ...)
+#define __sanitizer_syscall_post_eventfd2(res, ...)
+#define __sanitizer_syscall_post_eventfd(res, ...)
+#define __sanitizer_syscall_post_execve(res, ...)
+#define __sanitizer_syscall_post_exit_group(res, ...)
+#define __sanitizer_syscall_post_exit(res, ...)
+#define __sanitizer_syscall_post_faccessat(res, ...)
+#define __sanitizer_syscall_post_fadvise64_64(res, ...)
+#define __sanitizer_syscall_post_fadvise64(res, ...)
+#define __sanitizer_syscall_post_fallocate(res, ...)
+#define __sanitizer_syscall_post_fanotify_init(res, ...)
+#define __sanitizer_syscall_post_fanotify_mark(res, ...)
+#define __sanitizer_syscall_post_fchdir(res, ...)
+#define __sanitizer_syscall_post_fchmodat(res, ...)
+#define __sanitizer_syscall_post_fchmod(res, ...)
+#define __sanitizer_syscall_post_fchown32(res, ...)
+#define __sanitizer_syscall_post_fchownat(res, ...)
+#define __sanitizer_syscall_post_fchown(res, ...)
+#define __sanitizer_syscall_post_fcntl64(res, ...)
+#define __sanitizer_syscall_post_fcntl(res, ...)
+#define __sanitizer_syscall_post_fdatasync(res, ...)
+#define __sanitizer_syscall_post_fgetxattr(res, ...)
+#define __sanitizer_syscall_post_flistxattr(res, ...)
+#define __sanitizer_syscall_post_flock(res, ...)
+#define __sanitizer_syscall_post_fork(res, ...)
+#define __sanitizer_syscall_post_fremovexattr(res, ...)
+#define __sanitizer_syscall_post_fsetxattr(res, ...)
+#define __sanitizer_syscall_post_fstat64(res, ...)
+#define __sanitizer_syscall_post_fstatat64(res, ...)
+#define __sanitizer_syscall_post_fstatfs64(res, ...)
+#define __sanitizer_syscall_post_fstatfs(res, ...)
+#define __sanitizer_syscall_post_fstat(res, ...)
+#define __sanitizer_syscall_post_fsync(res, ...)
+#define __sanitizer_syscall_post_ftime(res, ...)
+#define __sanitizer_syscall_post_ftruncate64(res, ...)
+#define __sanitizer_syscall_post_ftruncate(res, ...)
+#define __sanitizer_syscall_post_futex(res, ...)
+#define __sanitizer_syscall_post_futimesat(res, ...)
+#define __sanitizer_syscall_post_getcpu(res, ...)
+#define __sanitizer_syscall_post_getcwd(res, ...)
+#define __sanitizer_syscall_post_getegid32(res, ...)
+#define __sanitizer_syscall_post_getegid(res, ...)
+#define __sanitizer_syscall_post_geteuid32(res, ...)
+#define __sanitizer_syscall_post_geteuid(res, ...)
+#define __sanitizer_syscall_post_getgid32(res, ...)
+#define __sanitizer_syscall_post_getgid(res, ...)
+#define __sanitizer_syscall_post_getgroups32(res, ...)
+#define __sanitizer_syscall_post_getgroups(res, ...)
+#define __sanitizer_syscall_post_getitimer(res, ...)
+#define __sanitizer_syscall_post_get_kernel_syms(res, ...)
+#define __sanitizer_syscall_post_get_mempolicy(res, ...)
+#define __sanitizer_syscall_post_getpeername(res, ...)
+#define __sanitizer_syscall_post_getpgid(res, ...)
+#define __sanitizer_syscall_post_getpgrp(res, ...)
+#define __sanitizer_syscall_post_getpid(res, ...)
+#define __sanitizer_syscall_post_getpmsg(res, ...)
+#define __sanitizer_syscall_post_getppid(res, ...)
+#define __sanitizer_syscall_post_getpriority(res, ...)
+#define __sanitizer_syscall_post_getresgid32(res, ...)
+#define __sanitizer_syscall_post_getresgid(res, ...)
+#define __sanitizer_syscall_post_getresuid32(res, ...)
+#define __sanitizer_syscall_post_getresuid(res, ...)
+#define __sanitizer_syscall_post_getrlimit(res, ...)
+#define __sanitizer_syscall_post_get_robust_list(res, ...)
+#define __sanitizer_syscall_post_getrusage(res, ...)
+#define __sanitizer_syscall_post_getsid(res, ...)
+#define __sanitizer_syscall_post_getsockname(res, ...)
+#define __sanitizer_syscall_post_getsockopt(res, ...)
+#define __sanitizer_syscall_post_get_thread_area(res, ...)
+#define __sanitizer_syscall_post_gettid(res, ...)
+#define __sanitizer_syscall_post_gettimeofday(res, ...)
+#define __sanitizer_syscall_post_getuid32(res, ...)
+#define __sanitizer_syscall_post_getuid(res, ...)
+#define __sanitizer_syscall_post_getxattr(res, ...)
+#define __sanitizer_syscall_post_gtty(res, ...)
+#define __sanitizer_syscall_post_idle(res, ...)
+#define __sanitizer_syscall_post_init_module(res, ...)
+#define __sanitizer_syscall_post_inotify_add_watch(res, ...)
+#define __sanitizer_syscall_post_inotify_init1(res, ...)
+#define __sanitizer_syscall_post_inotify_init(res, ...)
+#define __sanitizer_syscall_post_inotify_rm_watch(res, ...)
+#define __sanitizer_syscall_post_io_cancel(res, ...)
+#define __sanitizer_syscall_post_ioctl(res, ...)
+#define __sanitizer_syscall_post_io_destroy(res, ...)
+#define __sanitizer_syscall_post_io_getevents(res, ...)
+#define __sanitizer_syscall_post_ioperm(res, ...)
+#define __sanitizer_syscall_post_iopl(res, ...)
+#define __sanitizer_syscall_post_ioprio_get(res, ...)
+#define __sanitizer_syscall_post_ioprio_set(res, ...)
+#define __sanitizer_syscall_post_io_setup(res, ...)
+#define __sanitizer_syscall_post_io_submit(res, ...)
+#define __sanitizer_syscall_post_ipc(res, ...)
+#define __sanitizer_syscall_post_kexec_load(res, ...)
+#define __sanitizer_syscall_post_keyctl(res, ...)
+#define __sanitizer_syscall_post_kill(res, ...)
+#define __sanitizer_syscall_post_lchown32(res, ...)
+#define __sanitizer_syscall_post_lchown(res, ...)
+#define __sanitizer_syscall_post_lgetxattr(res, ...)
+#define __sanitizer_syscall_post_linkat(res, ...)
+#define __sanitizer_syscall_post_link(res, ...)
+#define __sanitizer_syscall_post_listen(res, ...)
+#define __sanitizer_syscall_post_listxattr(res, ...)
+#define __sanitizer_syscall_post_llistxattr(res, ...)
+#define __sanitizer_syscall_post__llseek(res, ...)
+#define __sanitizer_syscall_post_lock(res, ...)
+#define __sanitizer_syscall_post_lookup_dcookie(res, ...)
+#define __sanitizer_syscall_post_lremovexattr(res, ...)
+#define __sanitizer_syscall_post_lseek(res, ...)
+#define __sanitizer_syscall_post_lsetxattr(res, ...)
+#define __sanitizer_syscall_post_lstat64(res, ...)
+#define __sanitizer_syscall_post_lstat(res, ...)
+#define __sanitizer_syscall_post_madvise1(res, ...)
+#define __sanitizer_syscall_post_madvise(res, ...)
+#define __sanitizer_syscall_post_mbind(res, ...)
+#define __sanitizer_syscall_post_migrate_pages(res, ...)
+#define __sanitizer_syscall_post_mincore(res, ...)
+#define __sanitizer_syscall_post_mkdirat(res, ...)
+#define __sanitizer_syscall_post_mkdir(res, ...)
+#define __sanitizer_syscall_post_mknodat(res, ...)
+#define __sanitizer_syscall_post_mknod(res, ...)
+#define __sanitizer_syscall_post_mlockall(res, ...)
+#define __sanitizer_syscall_post_mlock(res, ...)
+#define __sanitizer_syscall_post_mmap2(res, ...)
+#define __sanitizer_syscall_post_mmap(res, ...)
+#define __sanitizer_syscall_post_modify_ldt(res, ...)
+#define __sanitizer_syscall_post_mount(res, ...)
+#define __sanitizer_syscall_post_move_pages(res, ...)
+#define __sanitizer_syscall_post_mprotect(res, ...)
+#define __sanitizer_syscall_post_mpx(res, ...)
+#define __sanitizer_syscall_post_mq_getsetattr(res, ...)
+#define __sanitizer_syscall_post_mq_notify(res, ...)
+#define __sanitizer_syscall_post_mq_open(res, ...)
+#define __sanitizer_syscall_post_mq_timedreceive(res, ...)
+#define __sanitizer_syscall_post_mq_timedsend(res, ...)
+#define __sanitizer_syscall_post_mq_unlink(res, ...)
+#define __sanitizer_syscall_post_mremap(res, ...)
+#define __sanitizer_syscall_post_msgctl(res, ...)
+#define __sanitizer_syscall_post_msgget(res, ...)
+#define __sanitizer_syscall_post_msgrcv(res, ...)
+#define __sanitizer_syscall_post_msgsnd(res, ...)
+#define __sanitizer_syscall_post_msync(res, ...)
+#define __sanitizer_syscall_post_munlockall(res, ...)
+#define __sanitizer_syscall_post_munlock(res, ...)
+#define __sanitizer_syscall_post_munmap(res, ...)
+#define __sanitizer_syscall_post_name_to_handle_at(res, ...)
+#define __sanitizer_syscall_post_nanosleep(res, ...)
+#define __sanitizer_syscall_post_newfstatat(res, ...)
+#define __sanitizer_syscall_post__newselect(res, ...)
+#define __sanitizer_syscall_post_nfsservctl(res, ...)
+#define __sanitizer_syscall_post_nice(res, ...)
+#define __sanitizer_syscall_post_oldfstat(res, ...)
+#define __sanitizer_syscall_post_oldlstat(res, ...)
+#define __sanitizer_syscall_post_oldolduname(res, ...)
+#define __sanitizer_syscall_post_oldstat(res, ...)
+#define __sanitizer_syscall_post_olduname(res, ...)
+#define __sanitizer_syscall_post_openat(res, ...)
+#define __sanitizer_syscall_post_open_by_handle_at(res, ...)
+#define __sanitizer_syscall_post_open(res, ...)
+#define __sanitizer_syscall_post_pause(res, ...)
+#define __sanitizer_syscall_post_perf_event_open(res, ...)
+#define __sanitizer_syscall_post_personality(res, ...)
+#define __sanitizer_syscall_post_pipe2(res, ...)
+#define __sanitizer_syscall_post_pipe(res, ...)
+#define __sanitizer_syscall_post_pivot_root(res, ...)
+#define __sanitizer_syscall_post_poll(res, ...)
+#define __sanitizer_syscall_post_ppoll(res, ...)
+#define __sanitizer_syscall_post_prctl(res, ...)
+#define __sanitizer_syscall_post_pread64(res, ...)
+#define __sanitizer_syscall_post_preadv(res, ...)
+#define __sanitizer_syscall_post_prlimit64(res, ...)
+#define __sanitizer_syscall_post_process_vm_readv(res, ...)
+#define __sanitizer_syscall_post_process_vm_writev(res, ...)
+#define __sanitizer_syscall_post_profil(res, ...)
+#define __sanitizer_syscall_post_prof(res, ...)
+#define __sanitizer_syscall_post_pselect6(res, ...)
+#define __sanitizer_syscall_post_ptrace(res, ...)
+#define __sanitizer_syscall_post_putpmsg(res, ...)
+#define __sanitizer_syscall_post_pwrite64(res, ...)
+#define __sanitizer_syscall_post_pwritev(res, ...)
+#define __sanitizer_syscall_post_query_module(res, ...)
+#define __sanitizer_syscall_post_quotactl(res, ...)
+#define __sanitizer_syscall_post_readahead(res, ...)
+#define __sanitizer_syscall_post_readdir(res, ...)
+#define __sanitizer_syscall_post_readlinkat(res, ...)
+#define __sanitizer_syscall_post_readlink(res, ...)
+#define __sanitizer_syscall_post_read(res, ...)
+#define __sanitizer_syscall_post_readv(res, ...)
+#define __sanitizer_syscall_post_reboot(res, ...)
+#define __sanitizer_syscall_post_recvfrom(res, ...)
+#define __sanitizer_syscall_post_recvmmsg(res, ...)
+#define __sanitizer_syscall_post_remap_file_pages(res, ...)
+#define __sanitizer_syscall_post_removexattr(res, ...)
+#define __sanitizer_syscall_post_renameat(res, ...)
+#define __sanitizer_syscall_post_rename(res, ...)
+#define __sanitizer_syscall_post_request_key(res, ...)
+#define __sanitizer_syscall_post_restart_syscall(res, ...)
+#define __sanitizer_syscall_post_rmdir(res, ...)
+#define __sanitizer_syscall_post_rt_sigaction(res, ...)
+#define __sanitizer_syscall_post_rt_sigprocmask(res, ...)
+#define __sanitizer_syscall_post_rt_sigqueueinfo(res, ...)
+#define __sanitizer_syscall_post_rt_sigreturn(res, ...)
+#define __sanitizer_syscall_post_rt_sigsuspend(res, ...)
+#define __sanitizer_syscall_post_rt_sigtimedwait(res, ...)
+#define __sanitizer_syscall_post_rt_tgsigqueueinfo(res, ...)
+#define __sanitizer_syscall_post_sched_getaffinity(res, ...)
+#define __sanitizer_syscall_post_sched_getparam(res, ...)
+#define __sanitizer_syscall_post_sched_get_priority_max(res, ...)
+#define __sanitizer_syscall_post_sched_get_priority_min(res, ...)
+#define __sanitizer_syscall_post_sched_getscheduler(res, ...)
+#define __sanitizer_syscall_post_sched_rr_get_interval(res, ...)
+#define __sanitizer_syscall_post_sched_setaffinity(res, ...)
+#define __sanitizer_syscall_post_sched_setparam(res, ...)
+#define __sanitizer_syscall_post_sched_setscheduler(res, ...)
+#define __sanitizer_syscall_post_sched_yield(res, ...)
+#define __sanitizer_syscall_post_security(res, ...)
+#define __sanitizer_syscall_post_select(res, ...)
+#define __sanitizer_syscall_post_semctl(res, ...)
+#define __sanitizer_syscall_post_semget(res, ...)
+#define __sanitizer_syscall_post_semop(res, ...)
+#define __sanitizer_syscall_post_semtimedop(res, ...)
+#define __sanitizer_syscall_post_sendfile64(res, ...)
+#define __sanitizer_syscall_post_sendfile(res, ...)
+#define __sanitizer_syscall_post_sendmmsg(res, ...)
+#define __sanitizer_syscall_post_sendmsg(res, ...)
+#define __sanitizer_syscall_post_sendto(res, ...)
+#define __sanitizer_syscall_post_setdomainname(res, ...)
+#define __sanitizer_syscall_post_setfsgid32(res, ...)
+#define __sanitizer_syscall_post_setfsgid(res, ...)
+#define __sanitizer_syscall_post_setfsuid32(res, ...)
+#define __sanitizer_syscall_post_setfsuid(res, ...)
+#define __sanitizer_syscall_post_setgid32(res, ...)
+#define __sanitizer_syscall_post_setgid(res, ...)
+#define __sanitizer_syscall_post_setgroups32(res, ...)
+#define __sanitizer_syscall_post_setgroups(res, ...)
+#define __sanitizer_syscall_post_sethostname(res, ...)
+#define __sanitizer_syscall_post_setitimer(res, ...)
+#define __sanitizer_syscall_post_set_mempolicy(res, ...)
+#define __sanitizer_syscall_post_setns(res, ...)
+#define __sanitizer_syscall_post_setpgid(res, ...)
+#define __sanitizer_syscall_post_setpriority(res, ...)
+#define __sanitizer_syscall_post_setregid32(res, ...)
+#define __sanitizer_syscall_post_setregid(res, ...)
+#define __sanitizer_syscall_post_setresgid32(res, ...)
+#define __sanitizer_syscall_post_setresgid(res, ...)
+#define __sanitizer_syscall_post_setresuid32(res, ...)
+#define __sanitizer_syscall_post_setresuid(res, ...)
+#define __sanitizer_syscall_post_setreuid32(res, ...)
+#define __sanitizer_syscall_post_setreuid(res, ...)
+#define __sanitizer_syscall_post_setrlimit(res, ...)
+#define __sanitizer_syscall_post_set_robust_list(res, ...)
+#define __sanitizer_syscall_post_setsid(res, ...)
+#define __sanitizer_syscall_post_setsockopt(res, ...)
+#define __sanitizer_syscall_post_set_thread_area(res, ...)
+#define __sanitizer_syscall_post_set_tid_address(res, ...)
+#define __sanitizer_syscall_post_settimeofday(res, ...)
+#define __sanitizer_syscall_post_setuid32(res, ...)
+#define __sanitizer_syscall_post_setuid(res, ...)
+#define __sanitizer_syscall_post_setxattr(res, ...)
+#define __sanitizer_syscall_post_sgetmask(res, ...)
+#define __sanitizer_syscall_post_shmat(res, ...)
+#define __sanitizer_syscall_post_shmctl(res, ...)
+#define __sanitizer_syscall_post_shmdt(res, ...)
+#define __sanitizer_syscall_post_shmget(res, ...)
+#define __sanitizer_syscall_post_shutdown(res, ...)
+#define __sanitizer_syscall_post_sigaction(res, ...)
+#define __sanitizer_syscall_post_sigaltstack(res, ...)
+#define __sanitizer_syscall_post_signalfd4(res, ...)
+#define __sanitizer_syscall_post_signalfd(res, ...)
+#define __sanitizer_syscall_post_signal(res, ...)
+#define __sanitizer_syscall_post_sigpending(res, ...)
+#define __sanitizer_syscall_post_sigprocmask(res, ...)
+#define __sanitizer_syscall_post_sigreturn(res, ...)
+#define __sanitizer_syscall_post_sigsuspend(res, ...)
+#define __sanitizer_syscall_post_socketcall(res, ...)
+#define __sanitizer_syscall_post_socketpair(res, ...)
+#define __sanitizer_syscall_post_socket(res, ...)
+#define __sanitizer_syscall_post_splice(res, ...)
+#define __sanitizer_syscall_post_ssetmask(res, ...)
+#define __sanitizer_syscall_post_stat64(res, ...)
+#define __sanitizer_syscall_post_statfs64(res, ...)
+#define __sanitizer_syscall_post_statfs(res, ...)
+#define __sanitizer_syscall_post_stat(res, ...)
+#define __sanitizer_syscall_post_stime(res, ...)
+#define __sanitizer_syscall_post_stty(res, ...)
+#define __sanitizer_syscall_post_swapoff(res, ...)
+#define __sanitizer_syscall_post_swapon(res, ...)
+#define __sanitizer_syscall_post_symlinkat(res, ...)
+#define __sanitizer_syscall_post_symlink(res, ...)
+#define __sanitizer_syscall_post_sync_file_range(res, ...)
+#define __sanitizer_syscall_post_syncfs(res, ...)
+#define __sanitizer_syscall_post_sync(res, ...)
+#define __sanitizer_syscall_post__sysctl(res, ...)
+#define __sanitizer_syscall_post_sysfs(res, ...)
+#define __sanitizer_syscall_post_sysinfo(res, ...)
+#define __sanitizer_syscall_post_syslog(res, ...)
+#define __sanitizer_syscall_post_tee(res, ...)
+#define __sanitizer_syscall_post_tgkill(res, ...)
+#define __sanitizer_syscall_post_timer_create(res, ...)
+#define __sanitizer_syscall_post_timer_delete(res, ...)
+#define __sanitizer_syscall_post_time(res, ...)
+#define __sanitizer_syscall_post_timerfd_create(res, ...)
+#define __sanitizer_syscall_post_timerfd_gettime(res, ...)
+#define __sanitizer_syscall_post_timerfd_settime(res, ...)
+#define __sanitizer_syscall_post_timer_getoverrun(res, ...)
+#define __sanitizer_syscall_post_timer_gettime(res, ...)
+#define __sanitizer_syscall_post_timer_settime(res, ...)
+#define __sanitizer_syscall_post_times(res, ...)
+#define __sanitizer_syscall_post_tkill(res, ...)
+#define __sanitizer_syscall_post_truncate64(res, ...)
+#define __sanitizer_syscall_post_truncate(res, ...)
+#define __sanitizer_syscall_post_tuxcall(res, ...)
+#define __sanitizer_syscall_post_ugetrlimit(res, ...)
+#define __sanitizer_syscall_post_ulimit(res, ...)
+#define __sanitizer_syscall_post_umask(res, ...)
+#define __sanitizer_syscall_post_umount2(res, ...)
+#define __sanitizer_syscall_post_umount(res, ...)
+#define __sanitizer_syscall_post_uname(res, ...)
+#define __sanitizer_syscall_post_unlinkat(res, ...)
+#define __sanitizer_syscall_post_unlink(res, ...)
+#define __sanitizer_syscall_post_unshare(res, ...)
+#define __sanitizer_syscall_post_uselib(res, ...)
+#define __sanitizer_syscall_post_ustat(res, ...)
+#define __sanitizer_syscall_post_utimensat(res, ...)
+#define __sanitizer_syscall_post_utime(res, ...)
+#define __sanitizer_syscall_post_utimes(res, ...)
+#define __sanitizer_syscall_post_vfork(res, ...)
+#define __sanitizer_syscall_post_vhangup(res, ...)
+#define __sanitizer_syscall_post_vm86old(res, ...)
+#define __sanitizer_syscall_post_vm86(res, ...)
+#define __sanitizer_syscall_post_vmsplice(res, ...)
+#define __sanitizer_syscall_post_vserver(res, ...)
+#define __sanitizer_syscall_post_waitid(res, ...)
+#define __sanitizer_syscall_post_write(res, ...)
+#define __sanitizer_syscall_post_writev(res, ...)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // SANITIZER_LINUX_SYSCALL_HOOKS_H
diff --git a/include/sanitizer/msan_interface.h b/include/sanitizer/msan_interface.h
index 1a76dd60599f..9eff7b597b69 100644
--- a/include/sanitizer/msan_interface.h
+++ b/include/sanitizer/msan_interface.h
@@ -16,106 +16,87 @@
#include <sanitizer/common_interface_defs.h>
-using __sanitizer::uptr;
-using __sanitizer::sptr;
-using __sanitizer::u32;
-
#ifdef __cplusplus
extern "C" {
#endif
-// FIXME: document all interface functions.
-
-SANITIZER_INTERFACE_ATTRIBUTE
-int __msan_get_track_origins();
-
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_init();
-
-// Print a warning and maybe return.
-// This function can die based on flags()->exit_code.
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_warning();
-
-// Print a warning and die.
-// Intrumentation inserts calls to this function when building in "fast" mode
-// (i.e. -mllvm -msan-keep-going)
-SANITIZER_INTERFACE_ATTRIBUTE __attribute__((noreturn))
-void __msan_warning_noreturn();
-
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_unpoison(void *a, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_clear_and_unpoison(void *a, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void* __msan_memcpy(void *dst, const void *src, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void* __msan_memset(void *s, int c, uptr n);
-SANITIZER_INTERFACE_ATTRIBUTE
-void* __msan_memmove(void* dest, const void* src, uptr n);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_copy_poison(void *dst, const void *src, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_copy_origin(void *dst, const void *src, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_move_poison(void *dst, const void *src, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_poison(void *a, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_poison_stack(void *a, uptr size);
-
-// Copy size bytes from src to dst and unpoison the result.
-// Useful to implement unsafe loads.
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_load_unpoisoned(void *src, uptr size, void *dst);
-
-// Returns the offset of the first (at least partially) poisoned byte,
-// or -1 if the whole range is good.
-SANITIZER_INTERFACE_ATTRIBUTE
-sptr __msan_test_shadow(const void *x, uptr size);
-
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_set_origin(void *a, uptr size, u32 origin);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_set_alloca_origin(void *a, uptr size, const char *descr);
-SANITIZER_INTERFACE_ATTRIBUTE
-u32 __msan_get_origin(void *a);
-
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_clear_on_return();
-
-// Default: -1 (don't exit on error).
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_set_exit_code(int exit_code);
-
-SANITIZER_INTERFACE_ATTRIBUTE
-int __msan_set_poison_in_malloc(int do_poison);
-
-// For testing.
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_set_expect_umr(int expect_umr);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_break_optimization(void *x);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_print_shadow(const void *x, uptr size);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_print_param_shadow();
-SANITIZER_INTERFACE_ATTRIBUTE
-int __msan_has_dynamic_component();
-
-// Returns x such that %fs:x is the first byte of __msan_retval_tls.
-SANITIZER_INTERFACE_ATTRIBUTE
-int __msan_get_retval_tls_offset();
-SANITIZER_INTERFACE_ATTRIBUTE
-int __msan_get_param_tls_offset();
-
-// For testing.
-SANITIZER_INTERFACE_ATTRIBUTE
-u32 __msan_get_origin_tls();
-SANITIZER_INTERFACE_ATTRIBUTE
-const char *__msan_get_origin_descr_if_stack(u32 id);
-SANITIZER_INTERFACE_ATTRIBUTE
-void __msan_partial_poison(void* data, void* shadow, uptr size);
+#if __has_feature(memory_sanitizer)
+ /* Returns a string describing a stack origin.
+ Return NULL if the origin is invalid, or is not a stack origin. */
+ const char *__msan_get_origin_descr_if_stack(uint32_t id);
+
+
+ /* Set raw origin for the memory range. */
+ void __msan_set_origin(const void *a, size_t size, uint32_t origin);
+
+ /* Get raw origin for an address. */
+ uint32_t __msan_get_origin(const void *a);
+
+ /* Returns non-zero if tracking origins. */
+ int __msan_get_track_origins();
+
+ /* Returns the origin id of the latest UMR in the calling thread. */
+ uint32_t __msan_get_umr_origin();
+
+ /* Make memory region fully initialized (without changing its contents). */
+ void __msan_unpoison(const void *a, size_t size);
+
+ /* Make memory region fully uninitialized (without changing its contents). */
+ void __msan_poison(const void *a, size_t size);
+
+ /* Make memory region partially uninitialized (without changing its contents).
+ */
+ void __msan_partial_poison(const void* data, void* shadow, size_t size);
+
+ /* Returns the offset of the first (at least partially) poisoned byte in the
+ memory range, or -1 if the whole range is good. */
+ intptr_t __msan_test_shadow(const void *x, size_t size);
+
+ /* Set exit code when error(s) were detected.
+ Value of 0 means don't change the program exit code. */
+ void __msan_set_exit_code(int exit_code);
+
+ /* For testing:
+ __msan_set_expect_umr(1);
+ ... some buggy code ...
+ __msan_set_expect_umr(0);
+ The last line will verify that a UMR happened. */
+ void __msan_set_expect_umr(int expect_umr);
+
+ /* Print shadow and origin for the memory range to stdout in a human-readable
+ format. */
+ void __msan_print_shadow(const void *x, size_t size);
+
+ /* Print current function arguments shadow and origin to stdout in a
+ human-readable format. */
+ void __msan_print_param_shadow();
+
+ /* Returns true if running under a dynamic tool (DynamoRio-based). */
+ int __msan_has_dynamic_component();
+
+ /* Tell MSan about newly allocated memory (ex.: custom allocator).
+ Memory will be marked uninitialized, with origin at the call site. */
+ void __msan_allocated_memory(const void* data, size_t size);
+
+#else // __has_feature(memory_sanitizer)
+
+#define __msan_get_origin_descr_if_stack(id) ((const char*)0)
+#define __msan_set_origin(a, size, origin)
+#define __msan_get_origin(a) ((uint32_t)-1)
+#define __msan_get_track_origins() (0)
+#define __msan_get_umr_origin() ((uint32_t)-1)
+#define __msan_unpoison(a, size)
+#define __msan_poison(a, size)
+#define __msan_partial_poison(data, shadow, size)
+#define __msan_test_shadow(x, size) ((intptr_t)-1)
+#define __msan_set_exit_code(exit_code)
+#define __msan_set_expect_umr(expect_umr)
+#define __msan_print_shadow(x, size)
+#define __msan_print_param_shadow()
+#define __msan_has_dynamic_component() (0)
+#define __msan_allocated_memory(data, size)
+
+#endif // __has_feature(memory_sanitizer)
#ifdef __cplusplus
} // extern "C"