aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/linux_c.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/linux_c.zig b/src/linux_c.zig
index d220a0f8c..6247df61d 100644
--- a/src/linux_c.zig
+++ b/src/linux_c.zig
@@ -276,3 +276,7 @@ pub const SystemErrno = enum(u8) {
break :brk map;
};
};
+
+pub fn preallocate_file(fd: std.os.fd_t, offset: std.os.off_t, len: std.os.off_t) anyerror!void {
+ _ = std.os.linux.fallocate(fd, 0, @intCast(i64, offset), len);
+}