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);
}
# 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))