aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example/passthrough_ll.c7
-rw-r--r--meson.build2
2 files changed, 8 insertions, 1 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index 1598958..b6ecaff 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -936,12 +936,19 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
int err;
(void) ino;
+#ifdef HAVE_FALLOCATE
+ err = fallocate(fi->fh, mode, offset, length);
+ if (err < 0)
+ err = errno;
+
+#elif HAVE_POSIX_FALLOCATE
if (mode) {
fuse_reply_err(req, EOPNOTSUPP);
return;
}
err = posix_fallocate(fi->fh, offset, length);
+#endif
fuse_reply_err(req, err);
}
diff --git a/meson.build b/meson.build
index 9c35745..5797fec 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,7 @@ cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
# Test for presence of some functions
test_funcs = [ 'fork', 'fstatat', 'openat', 'readlinkat', 'pipe2',
'splice', 'vmsplice', 'posix_fallocate', 'fdatasync',
- 'utimensat', 'copy_file_range' ]
+ 'utimensat', 'copy_file_range', 'fallocate' ]
foreach func : test_funcs
cfg.set('HAVE_' + func.to_upper(),
cc.has_function(func, prefix: include_default, args: args_default))