HomePhabricator

util: Detect posix_fallocate() instead of assuming

Description

util: Detect posix_fallocate() instead of assuming

Summary:

Don't assume that `posix_fallocate()` is available on Linux and not
available on other operating systems. At least FreeBSD has it and we
are not using it.

Properly check whether `posix_fallocate()` is present and use it if it
is.

Backport of core PR18437.

Test Plan:

ninja
grep HAVE_POSIX_FALLOCATE src/config/bitcoin-config.h

Check the HAVE_POSIX_FALLOCATE value is as expected (should be 1 on
linux).

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Mar 26 2020, 09:59
FabienCommitted on Jan 29 2021, 09:51
FabienPushed on Jan 29 2021, 09:53
Reviewer
Restricted Project
Differential Revision
D9108: util: Detect posix_fallocate() instead of assuming
Parents
rABC67d04b398ced: refactor: Cleanup clientversion.cpp
Branches
Unknown
Tags
Unknown