mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 14:55:25 +00:00
munmap allows address 0
fixes test suite regression on macOS from previous commit
This commit is contained in:
parent
5eaead6a56
commit
1d09cdaa6a
@ -27,7 +27,7 @@ pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int;
|
||||
pub extern "c" fn write(fd: c_int, buf: *const c_void, nbyte: usize) isize;
|
||||
pub extern "c" fn pwrite(fd: c_int, buf: *const c_void, nbyte: usize, offset: u64) isize;
|
||||
pub extern "c" fn mmap(addr: ?*c_void, len: usize, prot: c_int, flags: c_int, fd: c_int, offset: isize) ?*c_void;
|
||||
pub extern "c" fn munmap(addr: *c_void, len: usize) c_int;
|
||||
pub extern "c" fn munmap(addr: ?*c_void, len: usize) c_int;
|
||||
pub extern "c" fn unlink(path: [*]const u8) c_int;
|
||||
pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8;
|
||||
pub extern "c" fn waitpid(pid: c_int, stat_loc: *c_int, options: c_int) c_int;
|
||||
|
||||
@ -677,7 +677,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
|
||||
}
|
||||
|
||||
pub fn munmap(address: usize, length: usize) usize {
|
||||
return errnoWrap(c.munmap(@intToPtr(*c_void, address), length));
|
||||
return errnoWrap(c.munmap(@intToPtr(?*c_void, address), length));
|
||||
}
|
||||
|
||||
pub fn unlink(path: [*]const u8) usize {
|
||||
|
||||
@ -628,7 +628,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
|
||||
}
|
||||
|
||||
pub fn munmap(address: usize, length: usize) usize {
|
||||
return errnoWrap(c.munmap(@intToPtr(*c_void, address), length));
|
||||
return errnoWrap(c.munmap(@intToPtr(?*c_void, address), length));
|
||||
}
|
||||
|
||||
pub fn read(fd: i32, buf: [*]u8, nbyte: usize) usize {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user