void
set_option(const _SettableSocketOption& __option, error_code& __ec)
{
+# ifdef _GLIBCXX_HAVE_SYS_SOCKET_H
int __result = ::setsockopt(_M_sockfd, __option.level(_M_protocol),
__option.name(_M_protocol),
__option.data(_M_protocol),
__ec.assign(errno, generic_category());
else
__ec.clear();
+#else
+ __ec = std::make_error_code(std::errc::not_supported);
+#endif
}
template<typename _GettableSocketOption>
void
get_option(_GettableSocketOption& __option, error_code& __ec) const
{
+# ifdef _GLIBCXX_HAVE_SYS_SOCKET_H
int __result = ::getsockopt(_M_sockfd, __option.level(_M_protocol),
__option.name(_M_protocol),
__option.data(_M_protocol),
__ec.assign(errno, generic_category());
else
__ec.clear();
+#else
+ __ec = std::make_error_code(std::errc::not_supported);
+#endif
}
template<typename _IoControlCommand>
void test_option_types()
{
-#if __has_include(<socket.h>)
+#if __has_include(<sys/socket.h>)
check_boolean_sockopt<S::broadcast>();
check_boolean_sockopt<S::debug>();
void test_constants()
{
-#if __has_include(<socket.h>)
+#if __has_include(<sys/socket.h>)
static_assert( is_enum<S::shutdown_type>::value, "" );
static_assert( S::shutdown_receive != S::shutdown_send, "" );
static_assert( S::shutdown_receive != S::shutdown_both, "" );