#if defined(__APPLE__)
#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
#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() { … }