1 //===-- interception_linux.cc -----------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of AddressSanitizer, an address sanity checker.
10 // Linux-specific interception methods.
11 //===----------------------------------------------------------------------===//
14 #include "interception.h"
16 #include <stddef.h> // for NULL
17 #include <dlfcn.h> // for dlsym
19 namespace __interception
{
20 bool GetRealFunctionAddress(const char *func_name
, uptr
*func_addr
,
21 uptr real
, uptr wrapper
) {
22 *func_addr
= (uptr
)dlsym(RTLD_NEXT
, func_name
);
23 return real
== wrapper
;
25 } // namespace __interception