| author | |
| committer | |
| log | 54e72bcbd5b6baa04fd1c317458f78f55a18a464 |
| tree | f8440dd4ade5ee028f1654707d480425c426036f |
| parent | 6652f74e3fdd289063b1437643ed7d9c58d5ea90 |
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) |
| 3151 | 3151 | std.debug.assert(rc >= 0); |
| 3152 | 3152 | return buf[0..@intCast(rc) :0]; |
| 3153 | 3153 | } |
| 3154 | pub 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 { |
| 30 | 30 | _ = &linux.clock_gettime; |
| 31 | 31 | _ = &linux.memfd_create; |
| 32 | 32 | _ = &linux.readlinkat; |
| 33 | _ = &linux.write; | |
| 33 | 34 | } |