Page MenuHomePhabricator

util: Detect posix_fallocate() instead of assuming
ClosedPublic

Authored by Fabien on Jan 28 2021, 16:05.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCa952590df714: 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).

Diff Detail

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