aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/passthrough_ll.c')
-rw-r--r--example/passthrough_ll.c7
1 files changed, 7 insertions, 0 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);
}