authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-15 16:46:17 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-15 16:46:17 -08:00
log54e72bcbd5b6baa04fd1c317458f78f55a18a464
treef8440dd4ade5ee028f1654707d480425c426036f
parent6652f74e3fdd289063b1437643ed7d9c58d5ea90

add write


2 files changed, 7 insertions(+), 0 deletions(-)

mod.zig+6
......@@ -3151,3 +3151,9 @@ pub fn readlinkat(dirfd: c_int, noalias path: [*:0]const u8, noalias buf: []u8)
31513151 std.debug.assert(rc >= 0);
31523152 return buf[0..@intCast(rc) :0];
31533153}
3154pub fn write(fd: c_int, buf: []const u8) !usize {
3155 const rc = libc.write(fd, buf.ptr, buf.len);
3156 if (rc == -1) return errno.fromInt(errno.fromLibC());
3157 std.debug.assert(rc >= 0);
3158 return @intCast(rc);
3159}
test.zig+1
......@@ -30,4 +30,5 @@ test {
3030 _ = &linux.clock_gettime;
3131 _ = &linux.memfd_create;
3232 _ = &linux.readlinkat;
33 _ = &linux.write;
3334}