llvm/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp

//===- FuzzerUtilPosix.cpp - Misc utils for Posix. ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// Misc utils implementation using Posix API.
//===----------------------------------------------------------------------===//
#include "FuzzerPlatform.h"
#if LIBFUZZER_POSIX
#include "FuzzerIO.h"
#include "FuzzerInternal.h"
#include "FuzzerTracePC.h"
#include <cassert>
#include <chrono>
#include <cstring>
#include <errno.h>
#include <iomanip>
#include <signal.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
#include <thread>
#include <unistd.h>

namespace fuzzer {

static void AlarmHandler(int, siginfo_t *, void *) {}

static void (*upstream_segv_handler)(int, siginfo_t *, void *);

static void SegvHandler(int sig, siginfo_t *si, void *ucontext) {}

static void CrashHandler(int, siginfo_t *, void *) {}

static void InterruptHandler(int, siginfo_t *, void *) {}

static void GracefulExitHandler(int, siginfo_t *, void *) {}

static void FileSizeExceedHandler(int, siginfo_t *, void *) {}

static void SetSigaction(int signum,
                         void (*callback)(int, siginfo_t *, void *)) {}

// Return true on success, false otherwise.
bool ExecuteCommand(const Command &Cmd, std::string *CmdOutput) {}

void SetTimer(int Seconds) {}

void SetSignalHandler(const FuzzingOptions& Options) {}

void SleepSeconds(int Seconds) {}

unsigned long GetPid() {}

size_t GetPeakRSSMb() {}

FILE *OpenProcessPipe(const char *Command, const char *Mode) {}

int CloseProcessPipe(FILE *F) {}

const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt,
                         size_t PattLen) {}

std::string DisassembleCmd(const std::string &FileName) {}

std::string SearchRegexCmd(const std::string &Regex) {}

size_t PageSize() {}

}  // namespace fuzzer

#endif // LIBFUZZER_POSIX