HomePhabricator

build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL

Description

build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL

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

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1864

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Mar 5 2017, 09:29
deadalnixCommitted on Oct 3 2018, 11:31
deadalnixPushed on Oct 3 2018, 11:40
Reviewer
Restricted Project
Differential Revision
D1864: build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL
Parents
rSTAGING627cebb96e5f: Check that CheckRegularTransaction rejects coinbases and vice-versa
Branches
Unknown
Tags
Unknown