| ... | @@ -280,6 +280,7 @@ pub const libc = struct { | ... | @@ -280,6 +280,7 @@ pub const libc = struct { |
| 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 | pub extern fn fchmod(fildes: c_int, mode: mode_t) c_int; |
| | 283 | pub extern fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) c_int; |
| 283 | }; | 284 | }; |
| 284 | | 285 | |
| 285 | pub const natural_t = c_uint; | 286 | pub const natural_t = c_uint; |
| ... | @@ -569,3 +570,8 @@ pub fn fchmod(fd: c_int, mode: mode_t) !void { | ... | @@ -569,3 +570,8 @@ pub fn fchmod(fd: c_int, mode: mode_t) !void { |
| 569 | if (rc == -1) return errno.fromInt(errno.fromLibC()); | 570 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 570 | std.debug.assert(rc == 0); | 571 | std.debug.assert(rc == 0); |
| 571 | } | 572 | } |
| | 573 | pub fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) !void { |
| | 574 | const rc = libc.faccessat(fd, path, amode, flag); |
| | 575 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| | 576 | std.debug.assert(rc == 0); |
| | 577 | } |