1 //===-- sanitizer_common_nolibc.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 contains stubs for libc function to facilitate optional use of
10 // libc in no-libcdep sources.
11 //===----------------------------------------------------------------------===//
12 
13 #include "sanitizer_platform.h"
14 #include "sanitizer_common.h"
15 #include "sanitizer_libc.h"
16 
17 namespace __sanitizer {
18 
19 // The Windows implementations of these functions use the win32 API directly,
20 // bypassing libc.
21 #if !SANITIZER_WINDOWS
22 #if SANITIZER_LINUX
23 void LogMessageOnPrintf(const char *str) {}
24 #endif
25 void WriteToSyslog(const char *buffer) {}
26 void Abort() { internal__exit(1); }
27 void SleepForSeconds(int seconds) { internal_sleep(seconds); }
28 #endif // !SANITIZER_WINDOWS
29 
30 #if !SANITIZER_WINDOWS && !SANITIZER_MAC
31 void ListOfModules::init() {}
32 #endif
33 
34 }  // namespace __sanitizer
35