authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-22 13:50:44 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-22 13:50:44 -07:00
log6e828b498ea16af2d52b62922d18d868e1b85d2b
tree8aae2df879f150f540a7bd9889fd7cecce5f66cb
parent143e3db17dca31d456b30d53ce6184488a331f70
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

NullWriter: add writev


1 files changed, 12 insertions(+), 0 deletions(-)

null_writer.zig+12
......@@ -1,7 +1,13 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const extras = @import("extras");
34const nio = @import("./nio.zig");
45
6const sys = switch (builtin.target.os.tag) {
7 .linux => @import("sys-linux"),
8 else => unreachable,
9};
10
511pub const NullWriter = struct {
612 const W = nio.Writable(@This(), ._var);
713 pub const writeAll = W.writeAll;
......@@ -18,4 +24,10 @@ pub const NullWriter = struct {
1824 _ = self;
1925 return bytes.len;
2026 }
27 pub fn writev(self: NullWriter, iovec: []const sys.struct_iovec) WriteError!usize {
28 _ = self;
29 var res: u64 = 0;
30 for (iovec) |item| res += item.len;
31 return res;
32 }
2133};