diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-25 17:04:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-25 17:04:51 -0400 |
| commit | f112e8af2760f9b475289966db7c0c53f4c6b310 (patch) | |
| tree | c5ef1538c0bfa2bb37382c979ee90a3a881a584e /std/os/linux.zig | |
| parent | dc3c4197c6e6564fb2558768cf2102b868347442 (diff) | |
| parent | d1705baa749a696132e272974858fef8273614ff (diff) | |
| download | zig-f112e8af2760f9b475289966db7c0c53f4c6b310.tar.gz zig-f112e8af2760f9b475289966db7c0c53f4c6b310.zip | |
Merge pull request #3312 from ziglang/armv8-linux-musleabihf
Enable test coverage for armv8-linux-musleabihf
Diffstat (limited to 'std/os/linux.zig')
| -rw-r--r-- | std/os/linux.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/os/linux.zig b/std/os/linux.zig index 375c7eba84..7dcd01572e 100644 --- a/std/os/linux.zig +++ b/std/os/linux.zig @@ -190,11 +190,11 @@ pub fn umount2(special: [*]const u8, flags: u32) usize { return syscall2(SYS_umount2, @ptrToInt(special), flags); } -pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: isize) usize { +pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: u64) usize { if (@hasDecl(@This(), "SYS_mmap2")) { - return syscall6(SYS_mmap2, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @bitCast(usize, @divTrunc(offset, MMAP2_UNIT))); + return syscall6(SYS_mmap2, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @truncate(usize, offset / MMAP2_UNIT)); } else { - return syscall6(SYS_mmap, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @bitCast(usize, offset)); + return syscall6(SYS_mmap, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), offset); } } |
