zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7157189143e83dedb29d25553d2841ff2576dc5c (tree)
parent 8c4a2dc1dfe05a67eb9811b8c8291c5541816a99
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri, 19 Jul 2024 00:40:00 -0700

macos doesn't have pipe2

Diffstat:
Mlib/std/c.zig | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/std/c.zig b/lib/std/c.zig @@ -8903,8 +8903,10 @@ pub const sigaltstack = switch (native_os) { }; pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int; -pub extern "c" fn pipe2(fds: *[2]fd_t, flags: O) c_int; - +pub const pipe2 = switch (native_os) { + .dragonfly, .emscripten, .netbsd, .freebsd, .kfreebsd, .solaris, .illumos, .openbsd, .linux => private.pipe2, + else => {}, +}; pub const copy_file_range = switch (native_os) { .linux => private.copy_file_range, .freebsd, .kfreebsd => freebsd.copy_file_range, @@ -9686,6 +9688,7 @@ const private = struct { extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int; extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int; + extern "c" fn pipe2(fds: *[2]fd_t, flags: O) c_int; extern "c" fn readdir(dir: *DIR) ?*dirent; extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8; extern "c" fn sched_yield() c_int;