blob: 32361e2a9ddac52085eae36ef5b3b87c0269e836 [file] [log] [blame]
Alexey Samsonov8489f2a2012-02-08 19:52:01 +00001//===-- interception_linux.cc -----------------------------------*- 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// This file is a part of AddressSanitizer, an address sanity checker.
11//
12// Linux-specific interception methods.
13//===----------------------------------------------------------------------===//
14
15#ifdef __linux__
16
Evgeniy Stepanovc5d845d2012-02-13 12:37:56 +000017#include <stddef.h> // for NULL
Alexey Samsonov8489f2a2012-02-08 19:52:01 +000018#include <dlfcn.h> // for dlsym
19
20namespace __interception {
21bool GetRealFunctionAddress(const char *func_name, void **func_addr) {
22 *func_addr = dlsym(RTLD_NEXT, func_name);
23 return (*func_addr != NULL);
24}
25} // namespace __interception
26
27
28#endif // __linux__