xref: /freebsd/contrib/llvm-project/compiler-rt/lib/interception/interception_aix.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- interception_aix.h --------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of AddressSanitizer, an address sanity checker.
10 //
11 // AIX-specific interception methods.
12 //===----------------------------------------------------------------------===//
13 
14 #if SANITIZER_AIX
15 
16 #  if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
17 #    error \
18         "interception_aix.h should be included from interception library only"
19 #  endif
20 
21 #  ifndef INTERCEPTION_AIX_H
22 #    define INTERCEPTION_AIX_H
23 
24 namespace __interception {
25 bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,
26                        uptr wrapper);
27 }  // namespace __interception
28 
29 #    define INTERCEPT_FUNCTION_AIX(func)                \
30       ::__interception::InterceptFunction(              \
31           #func, (::__interception::uptr *)&REAL(func), \
32           (::__interception::uptr) & (func),            \
33           (::__interception::uptr) & WRAP(func))
34 
35 #  endif  // INTERCEPTION_AIX_H
36 #endif    // SANITIZER_AIX
37