| author | |
| committer | |
| log | 111e5ed0a24ca7e96d24e0967b6c28226c0f3297 |
| tree | 50effd60936806e068f2eed4cdcc0a365c9a7b7b |
| parent | e197968734b2a0c1dd77034611361a121ecfc5ab |
| signature |
2 files changed, 4 insertions(+), 1 deletions(-)
std/c/linux.zig+3| ... | ... | @@ -1,9 +1,12 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const maxInt = std.math.maxInt; | |
| 2 | 3 | usingnamespace std.c; |
| 3 | 4 | |
| 4 | 5 | extern "c" fn __errno_location() *c_int; |
| 5 | 6 | pub const _errno = __errno_location; |
| 6 | 7 | |
| 8 | pub const MAP_FAILED = @intToPtr(*c_void, maxInt(usize)); | |
| 9 | ||
| 7 | 10 | pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) c_int; |
| 8 | 11 | pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int; |
| 9 | 12 | pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int; |
std/os.zig+1-1| ... | ... | @@ -1961,7 +1961,7 @@ pub fn mmap( |
| 1961 | 1961 | ) MMapError![]align(mem.page_size) u8 { |
| 1962 | 1962 | const err = if (builtin.link_libc) blk: { |
| 1963 | 1963 | const rc = std.c.mmap(ptr, length, prot, flags, fd, offset); |
| 1964 | if (rc != MAP_FAILED) return @ptrCast([*]align(mem.page_size) u8, @alignCast(mem.page_size, rc))[0..length]; | |
| 1964 | if (rc != std.c.MAP_FAILED) return @ptrCast([*]align(mem.page_size) u8, @alignCast(mem.page_size, rc))[0..length]; | |
| 1965 | 1965 | break :blk @intCast(usize, system._errno().*); |
| 1966 | 1966 | } else blk: { |
| 1967 | 1967 | const rc = system.mmap(ptr, length, prot, flags, fd, offset); |