Page MenuHomePhabricator

build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL
ClosedPublic

Authored by deadalnix on Oct 2 2018, 14:10.

Details

Summary
  • build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL

Instead of the WIN32-specific workaround, detect lack of MSG_DONTWAIT
in the build system. This allows other platforms without MSG_DONTWAIT
to work too.

  • build: cleanup: define MSG_DONTWAIT/MSG_NO_SIGNAL locally

Define MSG_DONTWAIT and MSG_NO_SIGNAL in the implementation files that
use them (net.cpp and netbase.cpp), instead of compat.h which is
included all over the place.

This avoids putting them in the global namespace, as defining them as 0
is a hack that works for our specific usage, but it is not a general
solution.

Also makes sure they are defined only once so the !defined(MSG_x) guard can go.

  • compat: use unsigned int instead of u_int

u_int is not available on some platforms (not sure what standard it's
supposed to be part of), we don't use it anywhere else, and it doesn't
hurt to simply write unsigned int out here.

This is a backport of Core PR9921

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable