| ... | @@ -142,8 +142,8 @@ pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, fl | ... | @@ -142,8 +142,8 @@ pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, fl |
| 142 | return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); | 142 | return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); |
| 143 | } | 143 | } |
| 144 | | 144 | |
| 145 | pub fn fallocate(fd: i32, mode: i32, offset: u64, length: u64) usize { | 145 | pub fn fallocate(fd: i32, mode: i32, offset: i64, length: i64) usize { |
| 146 | if (@sizeOf(usize) == 4) { | 146 | if (usize_bits < 64) { |
| 147 | const offset_halves = splitValue64(offset); | 147 | const offset_halves = splitValue64(offset); |
| 148 | const length_halves = splitValue64(length); | 148 | const length_halves = splitValue64(length); |
| 149 | return syscall6( | 149 | return syscall6( |
| ... | @@ -160,8 +160,8 @@ pub fn fallocate(fd: i32, mode: i32, offset: u64, length: u64) usize { | ... | @@ -160,8 +160,8 @@ pub fn fallocate(fd: i32, mode: i32, offset: u64, length: u64) usize { |
| 160 | .fallocate, | 160 | .fallocate, |
| 161 | @bitCast(usize, @as(isize, fd)), | 161 | @bitCast(usize, @as(isize, fd)), |
| 162 | @bitCast(usize, @as(isize, mode)), | 162 | @bitCast(usize, @as(isize, mode)), |
| 163 | offset, | 163 | @bitCast(u64, offset), |
| 164 | length, | 164 | @bitCast(u64, length), |
| 165 | ); | 165 | ); |
| 166 | } | 166 | } |
| 167 | } | 167 | } |