// detail/impl/socket_ops.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
get_last_error(ec, result != 0);
#if defined(__linux__)
if (result != 0 && ec == boost::asio::error::try_again)
- ec = boost::asio::error::no_buffer_space;
+ {
+ if (addr->sa_family == AF_UNIX)
+ ec = boost::asio::error::in_progress;
+ else
+ ec = boost::asio::error::no_buffer_space;
+ }
#endif // defined(__linux__)
return result;
}
# endif // defined(ENOTTY)
#else // defined(SIOCATMARK)
int value = ::sockatmark(s);
- get_last_error(ec, result < 0);
+ get_last_error(ec, value < 0);
#endif // defined(SIOCATMARK)
return ec ? false : value != 0;
return s;
#elif defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__)
socket_type s = ::socket(af, type, protocol);
- get_last_error(ec, s < 0);
+ get_last_error(ec, s == invalid_socket);
+ if (s == invalid_socket)
+ return s;
int optval = 1;
int result = ::setsockopt(s, SOL_SOCKET,