1 //===-- sanitizer/common_interface_defs.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 // Common part of the public sanitizer interface. 11 //===----------------------------------------------------------------------===// 12 13 #ifndef SANITIZER_COMMON_INTERFACE_DEFS_H 14 #define SANITIZER_COMMON_INTERFACE_DEFS_H 15 16 #include <stddef.h> 17 #include <stdint.h> 18 19 // GCC does not understand __has_feature. 20 #if !defined(__has_feature) 21 # define __has_feature(x) 0 22 #endif 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 // Tell the tools to write their reports to "path.<pid>" instead of stderr. 28 void __sanitizer_set_report_path(const char *path); 29 30 // Tell the tools to write their reports to given file descriptor instead of 31 // stderr. 32 void __sanitizer_set_report_fd(int fd); 33 34 // Notify the tools that the sandbox is going to be turned on. The reserved 35 // parameter will be used in the future to hold a structure with functions 36 // that the tools may call to bypass the sandbox. 37 void __sanitizer_sandbox_on_notify(void *reserved); 38 39 // This function is called by the tool when it has just finished reporting 40 // an error. 'error_summary' is a one-line string that summarizes 41 // the error message. This function can be overridden by the client. 42 void __sanitizer_report_error_summary(const char *error_summary); 43 44 #ifdef __cplusplus 45 } // extern "C" 46 #endif 47 48 #endif // SANITIZER_COMMON_INTERFACE_DEFS_H 49