[asio-users] asio::error::basic_errors::not_supported is missing
Brought to you by:
chris_kohlhoff
From: Vinícius d. S. O. <vin...@gm...> - 2023-12-07 02:27:23
|
On POSIX systems, asio::error::basic_errors will be just an alias for values that ASIO uses from std::system_category(). One of these is operation_not_supported (which is EOPNOTSUPP). However EOPNOTSUPP may alias ENOTSUP on some systems. For Linux and FreeBSD, these errno values are the same. For OpenBSD, macOS, and a few others they differ. When a composed operation throws ENOTSUP, the caller might accidentally catch EOPNOTSUPP on Linux or FreeBSD. There isn't really any good answer here. However I think Boost.Asio should just define asio::error::basic_errors::not_supported and document that not_supported and operation_not_supported might be aliases on some systems (they are on Linux and FreeBSD). That's what C++11 already does in a way by including both definitions so Boost.Asio could just follow along as well. -- Vinícius dos Santos Oliveira https://vinipsmaker.github.io/ |