folly/folly/io/async/AsyncPipe.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/io/async/AsyncPipe.h>

#include <folly/FileUtil.h>
#include <folly/Utility.h>
#include <folly/detail/FileUtilDetail.h>
#include <folly/io/async/AsyncSocketException.h>

string;
unique_ptr;

namespace folly {

AsyncPipeReader::~AsyncPipeReader() {}

void AsyncPipeReader::failRead(const AsyncSocketException& ex) {}

void AsyncPipeReader::close() {}

#ifdef _WIN32
static int recv_internal(NetworkSocket s, void* buf, size_t count) {
  auto r = netops::recv(s, buf, count, 0);
  if (r == -1 && WSAGetLastError() == WSAEWOULDBLOCK) {
    errno = EAGAIN;
  }
  return folly::to_narrow(r);
}
#endif

void AsyncPipeReader::handlerReady(uint16_t events) noexcept {}

void AsyncPipeWriter::write(
    unique_ptr<folly::IOBuf> buf, AsyncWriter::WriteCallback* callback) {}

void AsyncPipeWriter::writeChain(
    folly::AsyncWriter::WriteCallback* callback,
    std::unique_ptr<folly::IOBuf>&& buf,
    WriteFlags) {}

void AsyncPipeWriter::closeOnEmpty() {}

void AsyncPipeWriter::closeNow() {}

void AsyncPipeWriter::failAllWrites(const AsyncSocketException& ex) {}

void AsyncPipeWriter::handlerReady(uint16_t events) noexcept {}

#ifdef _WIN32
static int send_internal(NetworkSocket s, const void* buf, size_t count) {
  auto r = netops::send(s, buf, count, 0);
  if (r == -1 && WSAGetLastError() == WSAEWOULDBLOCK) {
    errno = EAGAIN;
  }
  return folly::to_narrow(r);
}
#endif

void AsyncPipeWriter::handleWrite() {}

} // namespace folly