Use a platform whitelist for opting into the SIGIO notifier

My bet is that the Illumos, Cygwin, and WSL are not the only Unix-like
systems where the SIGIO notifier won't work, and since we have a good
enough and portable alternative that we can use be default on other
platforms where we don't specifically know it'll work, it doesn't make
sense not to go with that one instead.

Even if this patch is reverted at some point and we go back to
blacklisting platforms that *don't* support the SIGIO strategy, this is
almost certainly the right choice for inclusion in a minor release like
3.2.0.

See discussion in #6585.
This commit is contained in:
Mahmoud Al-Qudsi 2021-02-24 14:36:58 -06:00
parent b8d28158a6
commit 42d9f33e16

View File

@ -1582,7 +1582,12 @@ universal_notifier_t::notifier_strategy_t universal_notifier_t::resolve_default_
return strategy_notifyd;
#elif defined(__CYGWIN__)
return strategy_shmem_polling;
#elif defined(SIGIO)
#elif defined(SIGIO) && (defined(__APPLE__) || defined(__BSD__) || defined(__linux__))
// The SIGIO notifier relies on an extremely specific interaction between signal handling and
// O_ASYNC writes, and doesn't excercise codepaths that are particularly well explored on all
// POSIX and POSIX-like systems, so we only explicitly enable it on platforms where it's known
// to work. See discussion in #6585 for examples of breakage.
//
// The SIGIO notifier does not yet work on WSL. See #7429
if (is_windows_subsystem_for_linux()) {
return strategy_named_pipe;