| ... | @@ -2622,6 +2622,10 @@ pub const libc = struct { | ... | @@ -2622,6 +2622,10 @@ pub const libc = struct { |
| 2622 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/write.html | 2622 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/write.html |
| 2623 | pub extern fn write(fd: c_int, buf: *const anyopaque, n: usize) isize; | 2623 | pub extern fn write(fd: c_int, buf: *const anyopaque, n: usize) isize; |
| 2624 | | 2624 | |
| | 2625 | /// ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); |
| | 2626 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/writev.html |
| | 2627 | pub extern fn writev(fd: c_int, iovec: [*]const struct_iovec, count: c_int) isize; |
| | 2628 | |
| 2625 | /// double y0(double x); | 2629 | /// double y0(double x); |
| 2626 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/y0.html | 2630 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/y0.html |
| 2627 | pub extern fn y0(x: f64) f64; | 2631 | pub extern fn y0(x: f64) f64; |
| ... | @@ -3157,3 +3161,9 @@ pub fn write(fd: c_int, buf: []const u8) !usize { | ... | @@ -3157,3 +3161,9 @@ pub fn write(fd: c_int, buf: []const u8) !usize { |
| 3157 | std.debug.assert(rc >= 0); | 3161 | std.debug.assert(rc >= 0); |
| 3158 | return @intCast(rc); | 3162 | return @intCast(rc); |
| 3159 | } | 3163 | } |
| | 3164 | pub fn writev(fd: c_int, iovec: []const struct_iovec) !usize { |
| | 3165 | const rc = libc.writev(fd, iovec.ptr, @intCast(iovec.len)); |
| | 3166 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| | 3167 | std.debug.assert(rc >= 0); |
| | 3168 | return @intCast(rc); |
| | 3169 | } |