Fixes a bug where passing the deprecated const_buffers_1 and
mutable_buffers_1 types to asio::buffer() would result in the contiguous
iterator overloads being incorrectly chosen.
1. gcc 4.4 does not support __builtin_unreachable, which makes the
__GNUC__ branch definition to fail.
2. clang 3.5 doesn't support __builtin_assume and uses the last fallback
option. There, BOOST_ASIO_ASSUME is defined without arguments, meaning it
expands to incorrect code like `(void)0(base != 0)`. This also affects
any other compilers that are not handled by prior branches.
This commit only adds useful POSIX constants that don't conflict with
asio's signal handling strategy (e.g. SA_SIGINFO would break asio
interface, so it's avoided). Non-POSIX constants specific to certain
operating systems (e.g. Linux's SA_UNSUPPORTED) are ignored.
C++11 support is limited to channels with a single completion signature,
or channels with a void() signature (plus the error signature added by
the channel traits).
When registering a signal, it is now possible to pass flags that specify
the behaviour associated with the signal. These flags are specified as
an enum type in a new class, signal_set_base, and are passed to the
underlying sigaction() call. For example:
asio::signal_set sigs(my_io_context);
sigs.add(SIGINT, asio::signal_set::flags::restart);
Specifying flags other than flags::dont_care will fail unless
sigaction() is supported by the target operating system. Since signal
registration is global, conflicting flags (multiple registrations that
pass differing flags other than flags::dont_care) will also result in
an error.
Fixes a use-after destroy when shutdown() is called from the base class
execution_context destructor, and this in turns triggers the destruction
of outstanding work objects.
The value of user_data in a submission queue entry is only initialized
with with the ring itself, remaining unchanged after use and even
through calls to io_uring_get_sqe(3). Many submission paths apply
io_uring_sqe_set_data(3) but the remainder are submitted with stale
values that can apply completion operations on the wrong queues with the
wrong results, causing obscure bugs.