diff options
| author | Joran Dirk Greef <joran@ronomon.com> | 2020-10-31 13:39:33 +0200 |
|---|---|---|
| committer | Joran Dirk Greef <joran@ronomon.com> | 2020-10-31 13:39:33 +0200 |
| commit | 8fd88fdb31e638e9483e08fc42de2514fd4a616a (patch) | |
| tree | 64b83afe0dbc9fa486f58b96c76279cd2e9eb9ce /lib/std | |
| parent | 7c8d9cfa40ab96aede2a7fe8ec9dce6f10bc910a (diff) | |
| download | zig-8fd88fdb31e638e9483e08fc42de2514fd4a616a.tar.gz zig-8fd88fdb31e638e9483e08fc42de2514fd4a616a.zip | |
linux: add fallocate()
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os/linux.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index a126231db1..0af6467808 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -121,6 +121,16 @@ pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, fl return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); } +pub fn fallocate(fd: i32, mode: i32, offset: usize, len: usize) usize { + return syscall4( + .fallocate, + @bitCast(usize, @as(isize, fd)), + @bitCast(usize, @as(isize, mode)), + offset, + len, + ); +} + pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize { return syscall4(.futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout)); } |
