llvm/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp

//===-- ProcessLauncherPosixFork.cpp --------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/posix/ProcessLauncherPosixFork.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostProcess.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Host/ProcessLaunchInfo.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "llvm/Support/Errno.h"

#include <climits>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <unistd.h>

#include <sstream>
#include <csignal>

#ifdef __ANDROID__
#include <android/api-level.h>
#define PT_TRACE_ME
#endif

#if defined(__ANDROID_API__) && __ANDROID_API__ < 15
#include <linux/personality.h>
#elif defined(__linux__)
#include <sys/personality.h>
#endif

usingnamespacelldb;
usingnamespacelldb_private;

// Begin code running in the child process
// NB: This code needs to be async-signal safe, since we're invoking fork from
// multithreaded contexts.

static void write_string(int error_fd, const char *str) {}

[[noreturn]] static void ExitWithError(int error_fd,
                                       const char *operation) {}

static void DisableASLR(int error_fd) {}

static void DupDescriptor(int error_fd, const char *file, int fd, int flags) {}

namespace {
struct ForkFileAction {};

struct ForkLaunchInfo {};
} // namespace

[[noreturn]] static void ChildFunc(int error_fd, const ForkLaunchInfo &info) {}

// End of code running in the child process.

ForkFileAction::ForkFileAction(const FileAction &act)
    :{}

static std::vector<ForkFileAction>
MakeForkActions(const ProcessLaunchInfo &info) {}

static Environment::Envp FixupEnvironment(Environment env) {}

ForkLaunchInfo::ForkLaunchInfo(const ProcessLaunchInfo &info)
    :{}

HostProcess
ProcessLauncherPosixFork::LaunchProcess(const ProcessLaunchInfo &launch_info,
                                        Status &error) {}