1 // Copyright 2017 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "asan_impl.h"
6
7 #include <assert.h>
8
9 // This file provides the weak default definitions of sanitizer hook
10 // functions. The purpose of these interfaces is for the sanitizer
11 // runtime library to override these definitions.
12
__sanitizer_startup_hook(int argc,char ** argv,char ** envp,void * stack_base,size_t stack_size)13 __WEAK void __sanitizer_startup_hook(int argc, char** argv, char** envp,
14 void* stack_base, size_t stack_size) {
15 }
16
__sanitizer_before_thread_create_hook(thrd_t thread,bool detached,const char * name,void * stack_base,size_t stack_size)17 __WEAK void *__sanitizer_before_thread_create_hook(
18 thrd_t thread, bool detached, const char* name,
19 void* stack_base, size_t stack_size) {
20 return NULL;
21 }
22
__sanitizer_thread_create_hook(void * hook,thrd_t th,int error)23 __WEAK void __sanitizer_thread_create_hook(void* hook, thrd_t th, int error) {
24 assert(hook == NULL);
25 }
26
__sanitizer_thread_start_hook(void * hook,thrd_t self)27 __WEAK void __sanitizer_thread_start_hook(void* hook, thrd_t self) {
28 assert(hook == NULL);
29 }
30
__sanitizer_thread_exit_hook(void * hook,thrd_t self)31 __WEAK void __sanitizer_thread_exit_hook(void* hook, thrd_t self) {
32 assert(hook == NULL);
33 }
34