diff options
Diffstat (limited to '3rdparty/asio/include/asio/detail/descriptor_ops.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/detail/descriptor_ops.hpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/3rdparty/asio/include/asio/detail/descriptor_ops.hpp b/3rdparty/asio/include/asio/detail/descriptor_ops.hpp index 677f010ca50..384aa8d1d13 100644 --- a/3rdparty/asio/include/asio/detail/descriptor_ops.hpp +++ b/3rdparty/asio/include/asio/detail/descriptor_ops.hpp @@ -2,7 +2,7 @@ // detail/descriptor_ops.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -50,13 +50,18 @@ enum typedef unsigned char state_type; -template <typename ReturnType> -inline ReturnType error_wrapper(ReturnType return_value, - asio::error_code& ec) +inline void get_last_error( + asio::error_code& ec, bool is_error_condition) { - ec = asio::error_code(errno, - asio::error::get_system_category()); - return return_value; + if (!is_error_condition) + { + ec.assign(0, ec.category()); + } + else + { + ec = asio::error_code(errno, + asio::error::get_system_category()); + } } ASIO_DECL int open(const char* path, int flags, @@ -76,17 +81,30 @@ typedef iovec buf; ASIO_DECL std::size_t sync_read(int d, state_type state, buf* bufs, std::size_t count, bool all_empty, asio::error_code& ec); +ASIO_DECL std::size_t sync_read1(int d, state_type state, void* data, + std::size_t size, asio::error_code& ec); + ASIO_DECL bool non_blocking_read(int d, buf* bufs, std::size_t count, asio::error_code& ec, std::size_t& bytes_transferred); +ASIO_DECL bool non_blocking_read1(int d, void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred); + ASIO_DECL std::size_t sync_write(int d, state_type state, const buf* bufs, std::size_t count, bool all_empty, asio::error_code& ec); +ASIO_DECL std::size_t sync_write1(int d, state_type state, + const void* data, std::size_t size, asio::error_code& ec); + ASIO_DECL bool non_blocking_write(int d, const buf* bufs, std::size_t count, asio::error_code& ec, std::size_t& bytes_transferred); +ASIO_DECL bool non_blocking_write1(int d, + const void* data, std::size_t size, + asio::error_code& ec, std::size_t& bytes_transferred); + ASIO_DECL int ioctl(int d, state_type& state, long cmd, ioctl_arg_type* arg, asio::error_code& ec); |