| ... | @@ -121,14 +121,26 @@ pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, fl | ... | @@ -121,14 +121,26 @@ pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, fl |
| 121 | return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); | 121 | return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); |
| 122 | } | 122 | } |
| 123 | | 123 | |
| 124 | pub fn fallocate(fd: i32, mode: i32, offset: usize, len: usize) usize { | 124 | pub fn fallocate(fd: i32, mode: i32, offset: u64, len: u64) usize { |
| 125 | return syscall4( | 125 | if (@sizeOf(usize) == 4) { |
| 126 | .fallocate, | 126 | return syscall6( |
| 127 | @bitCast(usize, @as(isize, fd)), | 127 | .fallocate, |
| 128 | @bitCast(usize, @as(isize, mode)), | 128 | @bitCast(usize, @as(isize, fd)), |
| 129 | offset, | 129 | @bitCast(usize, @as(isize, mode)), |
| 130 | len, | 130 | @truncate(usize, offset >> 32), |
| 131 | ); | 131 | @truncate(usize, offset), |
| | 132 | @truncate(usize, len >> 32), |
| | 133 | @truncate(usize, len), |
| | 134 | ); |
| | 135 | } else { |
| | 136 | return syscall4( |
| | 137 | .fallocate, |
| | 138 | @bitCast(usize, @as(isize, fd)), |
| | 139 | @bitCast(usize, @as(isize, mode)), |
| | 140 | offset, |
| | 141 | len, |
| | 142 | ); |
| | 143 | } |
| 132 | } | 144 | } |
| 133 | | 145 | |
| 134 | pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize { | 146 | pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize { |