authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-25 21:13:06 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-25 21:13:06 -07:00
loga6446c21167ef9dce941ce2ea0aa673880b93358
treeaffd3399371e8e926df40408e16ef493df4ef4cb
parent602bb5704999acd385f39f2dd9cd2b9afa1480df
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add openat4


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

mod.zig+5
...@@ -3117,6 +3117,11 @@ pub fn openat(fd: c_int, file: [*:0]const u8, oflag: c_int) errno.Error!c_int {...@@ -3117,6 +3117,11 @@ pub fn openat(fd: c_int, file: [*:0]const u8, oflag: c_int) errno.Error!c_int {
3117 if (rc == -1) return errno.fromInt(errno.fromLibC());3117 if (rc == -1) return errno.fromInt(errno.fromLibC());
3118 return rc;3118 return rc;
3119}3119}
3120pub fn openat4(fd: c_int, file: [*:0]const u8, oflag: c_int, mode: mode_t) errno.Error!c_int {
3121 const rc = libc.openat(fd, file, oflag, mode);
3122 if (rc == -1) return errno.fromInt(errno.fromLibC());
3123 return rc;
3124}
3120pub fn close(fd: c_int) errno.Error!void {3125pub fn close(fd: c_int) errno.Error!void {
3121 const rc = libc.close(fd);3126 const rc = libc.close(fd);
3122 if (rc == -1) return errno.fromInt(errno.fromLibC());3127 if (rc == -1) return errno.fromInt(errno.fromLibC());
test.zig+1
...@@ -38,4 +38,5 @@ test {...@@ -38,4 +38,5 @@ test {
38 _ = &linux.renameat;38 _ = &linux.renameat;
39 _ = &linux.mmap;39 _ = &linux.mmap;
40 _ = &linux.munmap;40 _ = &linux.munmap;
41 _ = &linux.openat4;
41}42}