From a6446c21167ef9dce941ce2ea0aa673880b93358 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 25 Apr 2026 21:13:06 -0700 Subject: [PATCH] add openat4 --- mod.zig | 5 +++++ test.zig | 1 + 2 files changed, 6 insertions(+) diff --git a/mod.zig b/mod.zig index 6c0f8aa3516f20680bc687b9b5b792540abf3e40..2e8ffdfc217229cccc7fcbaaa00733182220d880 100644 --- a/mod.zig +++ b/mod.zig @@ -3117,6 +3117,11 @@ pub fn openat(fd: c_int, file: [*:0]const u8, oflag: c_int) errno.Error!c_int { if (rc == -1) return errno.fromInt(errno.fromLibC()); return rc; } +pub fn openat4(fd: c_int, file: [*:0]const u8, oflag: c_int, mode: mode_t) errno.Error!c_int { + const rc = libc.openat(fd, file, oflag, mode); + if (rc == -1) return errno.fromInt(errno.fromLibC()); + return rc; +} pub fn close(fd: c_int) errno.Error!void { const rc = libc.close(fd); if (rc == -1) return errno.fromInt(errno.fromLibC()); diff --git a/test.zig b/test.zig index 46b1a035b19d8ff54ccb2d3bbc51d5e229f29d4e..e14b603553c39e42f16b0732c3ea0c7296075bf0 100644 --- a/test.zig +++ b/test.zig @@ -38,4 +38,5 @@ test { _ = &linux.renameat; _ = &linux.mmap; _ = &linux.munmap; + _ = &linux.openat4; } -- 2.54.0