2012-10-29 Wei Mi <wmi@google.com>
[official-gcc.git] / libasan / interception / interception_linux.h
blob7940ef257c87eb28040371dd264e245917667923
1 //===-- interception_linux.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 is a part of AddressSanitizer, an address sanity checker.
9 //
10 // Linux-specific interception methods.
11 //===----------------------------------------------------------------------===//
13 #ifdef __linux__
15 #if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
16 # error "interception_linux.h should be included from interception library only"
17 #endif
19 #ifndef INTERCEPTION_LINUX_H
20 #define INTERCEPTION_LINUX_H
22 namespace __interception {
23 // returns true if a function with the given name was found.
24 bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
25 uptr real, uptr wrapper);
26 } // namespace __interception
28 #define INTERCEPT_FUNCTION_LINUX(func) \
29 ::__interception::GetRealFunctionAddress( \
30 #func, (::__interception::uptr*)&REAL(func), \
31 (::__interception::uptr)&(func), \
32 (::__interception::uptr)&WRAP(func))
34 #endif // INTERCEPTION_LINUX_H
35 #endif // __linux__