authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-19 00:40:00-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-19 00:40:00-07:00
log7157189143e83dedb29d25553d2841ff2576dc5c
tree3bf9d74c965535091cd59b458236bd45754564f4
parent8c4a2dc1dfe05a67eb9811b8c8291c5541816a99

macos doesn't have pipe2


1 files changed, 5 insertions(+), 2 deletions(-)

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