1 //===-- tsan_interceptors_posix.cpp ---------------------------------------===//
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 ThreadSanitizer (TSan), a race detector.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #define SANITIZER_COMMON_NO_REDEFINE_BUILTINS
14 
15 #include "tsan_interceptors.h"
16 #include "tsan_interface.h"
17 
18 using namespace __tsan;
19 
20 #include "sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc"
21 
22 extern "C" {
23 
24 void *__tsan_memcpy(void *dst, const void *src, uptr size) {
25   void *ctx;
26 #if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE
27   COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, dst, src, size);
28 #else
29   COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
30 #endif
31 }
32 
33 void *__tsan_memset(void *dst, int c, uptr size) {
34   void *ctx;
35   COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, dst, c, size);
36 }
37 
38 void *__tsan_memmove(void *dst, const void *src, uptr size) {
39   void *ctx;
40   COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
41 }
42 
43 }  // extern "C"
44