llvm/lldb/source/Utility/SelectHelper.cpp

//===-- SelectHelper.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
//
//===----------------------------------------------------------------------===//

#if defined(__APPLE__)
// Enable this special support for Apple builds where we can have unlimited
// select bounds. We tried switching to poll() and kqueue and we were panicing
// the kernel, so we have to stick with select for now.
#define _DARWIN_UNLIMITED_SELECT
#endif

#include "lldb/Utility/SelectHelper.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-types.h"

#include "llvm/ADT/DenseMap.h"

#include <algorithm>
#include <chrono>
#include <optional>

#include <cerrno>
#if defined(_WIN32)
// Define NOMINMAX to avoid macros that conflict with std::min and std::max
#define NOMINMAX
#include <winsock2.h>
#else
#include <sys/time.h>
#include <sys/select.h>
#endif


SelectHelper::SelectHelper()
    :{}

void SelectHelper::SetTimeout(const std::chrono::microseconds &timeout) {}

void SelectHelper::FDSetRead(lldb::socket_t fd) {}

void SelectHelper::FDSetWrite(lldb::socket_t fd) {}

void SelectHelper::FDSetError(lldb::socket_t fd) {}

bool SelectHelper::FDIsSetRead(lldb::socket_t fd) const {}

bool SelectHelper::FDIsSetWrite(lldb::socket_t fd) const {}

bool SelectHelper::FDIsSetError(lldb::socket_t fd) const {}

static void updateMaxFd(std::optional<lldb::socket_t> &vold,
                        lldb::socket_t vnew) {}

lldb_private::Status SelectHelper::Select() {}