Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
BlocksRuntime
asan
builtins
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
sanitizer_common
scudo
stats
tsan
ubsan
ubsan_minimal
xray
tests
CMakeLists.txt
weak_symbols.txt
xray_AArch64.cc
xray_always_instrument.txt
xray_arm.cc
xray_buffer_queue.cc
xray_buffer_queue.h
xray_defs.h
xray_fdr_log_records.h
xray_fdr_logging.cc
xray_fdr_logging.h
xray_fdr_logging_impl.h
xray_flags.cc
xray_flags.h
xray_flags.inc
xray_init.cc
xray_inmemory_log.cc
xray_inmemory_log.h
xray_interface.cc
xray_interface_internal.h
xray_log_interface.cc
xray_mips.cc
xray_mips64.cc
xray_never_instrument.txt
xray_powerpc64.cc
xray_powerpc64.inc
xray_trampoline_AArch64.S
xray_trampoline_arm.S
xray_trampoline_mips.S
xray_trampoline_mips64.S
xray_trampoline_powerpc64.cc
xray_trampoline_powerpc64_asm.S
xray_trampoline_x86_64.S
xray_tsc.h
xray_utils.cc
xray_utils.h
xray_x86_64.cc
xray_x86_64.inc
CMakeLists.txt
test
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
linux-packaging-mono/external/llvm-project/compiler-rt/lib/xray/xray_utils.h

42 lines
1.3 KiB
C
Raw Normal View History

//===-- xray_utils.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of XRay, a dynamic runtime instrumentation system.
//
// Some shared utilities for the XRay runtime implementation.
//
//===----------------------------------------------------------------------===//
#ifndef XRAY_UTILS_H
#define XRAY_UTILS_H
#include <sys/types.h>
#include <utility>
namespace __xray {
// Default implementation of the reporting interface for sanitizer errors.
void printToStdErr(const char *Buffer);
// EINTR-safe write routine, provided a file descriptor and a character range.
void retryingWriteAll(int Fd, char *Begin, char *End);
// Reads a long long value from a provided file.
bool readValueFromFile(const char *Filename, long long *Value);
// EINTR-safe read routine, providing a file descriptor and a character range.
std::pair<ssize_t, bool> retryingReadSome(int Fd, char *Begin, char *End);
// EINTR-safe open routine, uses flag-provided values for initialising a log
// file.
int getLogFD();
} // namespace __xray
#endif // XRAY_UTILS_H