Closes #32643.
Tested on OpenBSD 7.7 (amd64) by running a signet IBD, with the following patch on top to ensure the fallback isn’t executed anymore:
0diff --git a/src/util/fs_helpers.cpp b/src/util/fs_helpers.cpp
1index 84ac3690c9..c6dff2d29d 100644
2--- a/src/util/fs_helpers.cpp
3+++ b/src/util/fs_helpers.cpp
4@@ -208,6 +208,7 @@ void AllocateFileRange(FILE* file, unsigned int offset, unsigned int length)
5 // OpenBSD doesn't have fallocate or posix_fallocate, use ftruncate
6 if (0 == ftruncate(fileno(file), nEndPos)) return;
7 #endif
8+ assert(false);
9 // Fallback version
10 // TODO: just write one byte per block
11 static const char buf[65536] = {};
Didn’t run any performance tests, happy to take inputs on how to best measure any potential difference.
For another reference, here’s an OpenBSD ports patch for kitty that replaces posix_fallocate
with ftruncate
: https://github.com/openbsd/ports/blob/master/x11/kitty/patches/patch-glfw_backend_utils_c