authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-01-18 17:24:26+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-01-18 17:24:26+01:00
logf33bac2b12d41dc574cdac4d97089fdd0b31a336
treeb799b31df49802ff04c748ecaffab235f9e7963f
parent9d18df142c2b1583fcf0d59982b571699a63223e

std: define pipe2 only for os that support it


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

lib/std/c.zig-1
......@@ -108,7 +108,6 @@ pub extern "c" fn fork() c_int;
108108pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int;
109109pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int;
110110pub extern "c" fn pipe(fds: *[2]fd_t) c_int;
111pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
112111pub extern "c" fn mkdir(path: [*:0]const u8, mode: c_uint) c_int;
113112pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: u32) c_int;
114113pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int;
lib/std/c/dragonfly.zig+1
......@@ -13,6 +13,7 @@ pub fn _errno() *c_int {
1313pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
1414pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
1515pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
16pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
1617
1718pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int;
1819pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
lib/std/c/freebsd.zig+1
......@@ -14,6 +14,7 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
1414pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
1515
1616pub extern "c" fn pthread_getthreadid_np() c_int;
17pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
1718
1819pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int;
1920pub extern "c" fn malloc_usable_size(?*const c_void) usize;
lib/std/c/linux.zig+1
......@@ -86,6 +86,7 @@ pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_
8686pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
8787
8888pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
89pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
8990
9091pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
9192
lib/std/c/netbsd.zig+1
......@@ -16,6 +16,7 @@ pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_
1616
1717pub extern "c" fn _lwp_self() lwpid_t;
1818
19pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
1920pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
2021pub extern "c" fn __fstat50(fd: fd_t, buf: *Stat) c_int;
2122pub extern "c" fn __stat50(path: [*:0]const u8, buf: *Stat) c_int;
lib/std/c/openbsd.zig+1
......@@ -17,6 +17,7 @@ pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_
1717pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
1818
1919pub extern "c" fn getthrid() pid_t;
20pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
2021
2122pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
2223pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;