38 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains stubs for libc function to facilitate optional use of10// libc in no-libcdep sources.11//===----------------------------------------------------------------------===//12 13#include "sanitizer_common.h"14#include "sanitizer_flags.h"15#include "sanitizer_libc.h"16#include "sanitizer_platform.h"17 18namespace __sanitizer {19 20// The Windows implementations of these functions use the win32 API directly,21// bypassing libc.22#if !SANITIZER_WINDOWS23# if SANITIZER_LINUX24void LogMessageOnPrintf(const char *str) {}25void InitTlsSize() {}26# endif27void WriteToSyslog(const char *buffer) {}28void Abort() { internal__exit(1); }29bool CreateDir(const char *pathname) { return false; }30#endif // !SANITIZER_WINDOWS31 32#if !SANITIZER_WINDOWS && !SANITIZER_APPLE33void ListOfModules::init() {}34void InitializePlatformCommonFlags(CommonFlags *cf) {}35#endif36 37} // namespace __sanitizer38