Index: include/boost/asio/error.hpp =================================================================== --- include/boost/asio/error.hpp (revision 11500) +++ include/boost/asio/error.hpp (working copy) @@ -202,7 +202,8 @@ inline const boost::system::error_category& get_system_category() { - return boost::system::system_category; + //we can't just return the value, we need to call the function that initializes the singleton + return boost::system::get_system_category(); } #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) @@ -322,7 +323,7 @@ } // namespace detail #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - +using boost::system::system_category; static const boost::system::error_category& system_category = boost::asio::error::detail::get_system_category(); static const boost::system::error_category& netdb_category Index: include/boost/asio/detail/pipe_select_interrupter.hpp =================================================================== --- include/boost/asio/detail/pipe_select_interrupter.hpp (revision 11500) +++ include/boost/asio/detail/pipe_select_interrupter.hpp (working copy) @@ -47,6 +47,14 @@ write_descriptor_ = pipe_fds[1]; ::fcntl(write_descriptor_, F_SETFL, O_NONBLOCK); } + //This error case can easily occur is we open a lot of sockets all backed by + //different instances of io_service + else + { + boost::system::error_code ec(errno, + boost::asio::error::system_category); + throw boost::system::system_error(ec); + } } // Destructor.