authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 02:05:35 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 02:07:30 -07:00
log3265d1f06418eb0360d753c12116310a14b97bde
tree20c76ba40a6bb4ec4e74de9c91c332c75f8efea5
parentf79146abebfb35f1740cfaf119944b4d4aeb51fa
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add fchmod


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

sys_darwin.zig+6
...@@ -279,6 +279,7 @@ pub const libc = struct {...@@ -279,6 +279,7 @@ pub const libc = struct {
279 pub extern fn isatty(fd: c_int) c_int;279 pub extern fn isatty(fd: c_int) c_int;
280 pub extern fn lseek(fd: c_int, offset: off_t, whence: c_int) off_t;280 pub extern fn lseek(fd: c_int, offset: off_t, whence: c_int) off_t;
281 pub extern fn getcwd(buf: [*]u8, size: usize) ?[*:0]u8;281 pub extern fn getcwd(buf: [*]u8, size: usize) ?[*:0]u8;
282 pub extern fn fchmod(fildes: c_int, mode: mode_t) c_int;
282};283};
283284
284pub const natural_t = c_uint;285pub const natural_t = c_uint;
...@@ -563,3 +564,8 @@ pub fn getcwd(buf: []u8) ![*:0]u8 {...@@ -563,3 +564,8 @@ pub fn getcwd(buf: []u8) ![*:0]u8 {
563 if (rc == null) return errno.fromInt(errno.fromLibC());564 if (rc == null) return errno.fromInt(errno.fromLibC());
564 return rc.?;565 return rc.?;
565}566}
567pub fn fchmod(fd: c_int, mode: mode_t) !void {
568 const rc = libc.fchmod(fd, mode);
569 if (rc == -1) return errno.fromInt(errno.fromLibC());
570 std.debug.assert(rc == 0);
571}