1 //===-- tsan_interceptors_posix.cpp ---------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
11 //===----------------------------------------------------------------------===//
13 #define SANITIZER_COMMON_NO_REDEFINE_BUILTINS
15 #include "tsan_interceptors.h"
16 #include "tsan_interface.h"
18 using namespace __tsan
;
20 #include "sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc"
24 void *__tsan_memcpy(void *dst
, const void *src
, uptr size
) {
26 #if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE
27 COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx
, dst
, src
, size
);
29 COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx
, dst
, src
, size
);
33 void *__tsan_memset(void *dst
, int c
, uptr size
) {
35 COMMON_INTERCEPTOR_MEMSET_IMPL(ctx
, dst
, c
, size
);
38 void *__tsan_memmove(void *dst
, const void *src
, uptr size
) {
40 COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx
, dst
, src
, size
);