aboutsummaryrefslogtreecommitdiff
path: root/lib/std/c.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-02-05 13:54:56 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-02-06 14:23:23 -0800
commitd20d934a8a096607efda7e956a2131726036b09e (patch)
treeddc95eac3111e43f0706e392da756c76086f88dc /lib/std/c.zig
parentdef36f2e4460ec9dd500772daac100a655f019b7 (diff)
downloadzig-d20d934a8a096607efda7e956a2131726036b09e.tar.gz
zig-d20d934a8a096607efda7e956a2131726036b09e.zip
std: fix compilation under -lc
Diffstat (limited to 'lib/std/c.zig')
-rw-r--r--lib/std/c.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/c.zig b/lib/std/c.zig
index 6e1e9beb9f..4627f4103e 100644
--- a/lib/std/c.zig
+++ b/lib/std/c.zig
@@ -7867,6 +7867,11 @@ pub const MAP = switch (native_os) {
else => void,
};
+pub const MREMAP = switch (native_os) {
+ .linux => linux.MREMAP,
+ else => void,
+};
+
/// Used by libc to communicate failure. Not actually part of the underlying syscall.
pub const MAP_FAILED: *anyopaque = @ptrFromInt(maxInt(usize));
@@ -9508,6 +9513,7 @@ pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize;
pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize;
pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: MAP, fd: fd_t, offset: off_t) *anyopaque;
pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int;
+pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque;
pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: c_uint) c_int;
pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int;
pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_int) c_int;