chromium/base/sync_socket_posix.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/sync_socket.h"

#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <poll.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>

#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"

#if BUILDFLAG(IS_SOLARIS)
#include <sys/filio.h>
#endif

namespace base {

namespace {
// To avoid users sending negative message lengths to Send/Receive
// we clamp message lengths, which are size_t, to no more than INT_MAX.
const size_t kMaxMessageLength =;

// Writes |length| of |buffer| into |handle|.  Returns the number of bytes
// written or zero on error.  |length| must be greater than 0.
size_t SendHelper(SyncSocket::Handle handle, span<const uint8_t> data) {}

}  // namespace

// static
bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) {}

void SyncSocket::Close() {}

size_t SyncSocket::Send(span<const uint8_t> data) {}

size_t SyncSocket::Receive(span<uint8_t> buffer) {}

size_t SyncSocket::ReceiveWithTimeout(span<uint8_t> buffer, TimeDelta timeout) {}

size_t SyncSocket::Peek() {}

bool SyncSocket::IsValid() const {}

SyncSocket::Handle SyncSocket::handle() const {}

SyncSocket::Handle SyncSocket::Release() {}

bool CancelableSyncSocket::Shutdown() {}

size_t CancelableSyncSocket::Send(span<const uint8_t> data) {}

// static
bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
                                      CancelableSyncSocket* socket_b) {}

}  // namespace base