From c3b3fb889b6e08fa0cee863a355be844c8769cc9 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 28 Jul 2023 09:38:00 +0100 Subject: [PATCH] core-shim: add emulation for posix_fallocation if it is not available Signed-off-by: Colin Ian King --- core-shim.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core-shim.c b/core-shim.c index b3f9f8570..b942522ad 100644 --- a/core-shim.c +++ b/core-shim.c @@ -259,6 +259,7 @@ static int shim_emulate_fallocate(int fd, off_t offset, off_t len) */ int shim_posix_fallocate(int fd, off_t offset, off_t len) { +#if defined(HAVE_POSIX_FALLOCATE) int ret; const off_t chunk_len = (off_t)(1 * MB); @@ -283,6 +284,9 @@ int shim_posix_fallocate(int fd, off_t offset, off_t len) } while (len > 0); return 0; +#else + return shim_emulate_fallocate(fd, offset, len); +#endif }