tsan: do not sleep at exit if there are no other threads
[blocksruntime.git] / lib / interception / interception_linux.cc
blob009098fbd6579d2b4147cb9e0f1262ad1081e3a5
1 //===-- 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.
12 // Linux-specific interception methods.
13 //===----------------------------------------------------------------------===//
15 #ifdef __linux__
16 #include "interception.h"
18 #include <stddef.h> // for NULL
19 #include <dlfcn.h> // for dlsym
21 namespace __interception {
22 bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
23 uptr real, uptr wrapper) {
24 *func_addr = (uptr)dlsym(RTLD_NEXT, func_name);
25 return real == wrapper;
27 } // namespace __interception
30 #endif // __linux__