#include "./fuzztest/internal/logging.h"
#include <errno.h>
#include <string.h>
#include "absl/base/attributes.h"
#include "absl/base/const_init.h"
#include "absl/base/thread_annotations.h"
#include "absl/synchronization/mutex.h"
#if defined(__linux__)
#include <unistd.h>
#endif
#include <cstdio>
#include <cstdlib>
#include <string>
namespace fuzztest::internal {
namespace {
ABSL_CONST_INIT absl::Mutex stderr_file_guard_(absl::kConstInit);
FILE* stderr_file_ ABSL_GUARDED_BY(…);
}
#if defined(__linux__)
namespace {
FILE* stdout_file_ = …;
void Silence(int fd) { … }
void DupAndSilence(int fd) { … }
}
void SilenceTargetStdoutAndStderr() { … }
void RestoreTargetStdoutAndStderr() { … }
bool IsSilenceTargetEnabled() { … }
#else
void SilenceTargetStdoutAndStderr() { return; }
void RestoreTargetStdoutAndStderr() { return; }
bool IsSilenceTargetEnabled() { return false; }
#endif
FILE* GetStderr() { … }
void Abort(const char* file, int line, const std::string& message) { … }
const std::string* volatile test_abort_message = …;
void AbortInTest(const std::string& message) { … }
}