| author | |
| committer | |
| log | cd6795fc06affbb13c0223346c0c3fd47f5ab28f |
| tree | a2440201e394fcc89769bd158fbbd67a5c71b4f6 |
| parent | 07c943598d25c479d90ae51f89ba6dfe83b2d97e |
| signature |
The s390x mmap() syscall existed before Linux supported syscalls with 5+
parameters, so it takes a single pointer to an array of arguments instead.2 files changed, 26 insertions(+), 2 deletions(-)
lib/std/os/linux.zig+13-1| ... | ... | @@ -904,7 +904,19 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: MAP, fd: i32, of |
| 904 | 904 | @truncate(@as(u64, @bitCast(offset)) / MMAP2_UNIT), |
| 905 | 905 | ); |
| 906 | 906 | } else { |
| 907 | return syscall6( | |
| 907 | // The s390x mmap() syscall existed before Linux supported syscalls with 5+ parameters, so | |
| 908 | // it takes a single pointer to an array of arguments instead. | |
| 909 | return if (native_arch == .s390x) syscall1( | |
| 910 | .mmap, | |
| 911 | @intFromPtr(&[_]usize{ | |
| 912 | @intFromPtr(address), | |
| 913 | length, | |
| 914 | prot, | |
| 915 | @as(u32, @bitCast(flags)), | |
| 916 | @bitCast(@as(isize, fd)), | |
| 917 | @as(u64, @bitCast(offset)), | |
| 918 | }), | |
| 919 | ) else syscall6( | |
| 908 | 920 | .mmap, |
| 909 | 921 | @intFromPtr(address), |
| 910 | 922 | length, |
lib/std/os/linux/tls.zig+13-1| ... | ... | @@ -541,7 +541,19 @@ inline fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: linux.MAP, fd |
| 541 | 541 | @as(usize, @truncate(@as(u64, @bitCast(offset)) / linux.MMAP2_UNIT)), |
| 542 | 542 | }); |
| 543 | 543 | } else { |
| 544 | return @call(.always_inline, linux.syscall6, .{ | |
| 544 | // The s390x mmap() syscall existed before Linux supported syscalls with 5+ parameters, so | |
| 545 | // it takes a single pointer to an array of arguments instead. | |
| 546 | return if (native_arch == .s390x) @call(.always_inline, linux.syscall1, .{ | |
| 547 | .mmap, | |
| 548 | @intFromPtr(&[_]usize{ | |
| 549 | @intFromPtr(address), | |
| 550 | length, | |
| 551 | prot, | |
| 552 | @as(u32, @bitCast(flags)), | |
| 553 | @as(usize, @bitCast(@as(isize, fd))), | |
| 554 | @as(u64, @bitCast(offset)), | |
| 555 | }), | |
| 556 | }) else @call(.always_inline, linux.syscall6, .{ | |
| 545 | 557 | .mmap, |
| 546 | 558 | @intFromPtr(address), |
| 547 | 559 | length, |