1 //===-- interception_linux.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of AddressSanitizer, an address sanity checker.
12 // Linux-specific interception methods.
13 //===----------------------------------------------------------------------===//
17 #if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
18 # error "interception_linux.h should be included from interception library only"
21 #ifndef INTERCEPTION_LINUX_H
22 #define INTERCEPTION_LINUX_H
24 namespace __interception {
25 // returns true if a function with the given name was found.
26 bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
27 uptr real, uptr wrapper);
28 } // namespace __interception
30 #define INTERCEPT_FUNCTION_LINUX(func) \
31 ::__interception::GetRealFunctionAddress( \
32 #func, (::__interception::uptr*)&REAL(func), \
33 (::__interception::uptr)&(func), \
34 (::__interception::uptr)&WRAP(func))
36 #endif // INTERCEPTION_LINUX_H