feature. See also
. The project being documented here (as the example) is the Zig library itself.
Uring.fchmodat
fn fchmodat(
ev: *Evented,
sync: *CancelRegion.Sync,
dir: fd_t,
path: [*:0]const u8,
mode: linux.mode_t,
flags: u32,
) Dir.SetFilePermissionsError!void
File
Code
fn fchmodat(
ev: *Evented,
sync: *CancelRegion.Sync,
dir: fd_t,
path: [*:0]const u8,
mode: linux.mode_t,
flags: u32,
) Dir.SetFilePermissionsError!void {
_ = ev;
while (true) {
try sync.cancel_region.await(.nothing);
switch (linux.errno(linux.fchmodat2(dir, path, mode, flags))) {
.SUCCESS => return,
.INTR => {},
.BADF => |err| return errnoBug(err),
.FAULT => |err| return errnoBug(err),
.INVAL => |err| return errnoBug(err),
.ACCES => return error.AccessDenied,
.IO => return error.InputOutput,
.LOOP => return error.SymLinkLoop,
.NOENT => return error.FileNotFound,
.NOMEM => return error.SystemResources,
.NOTDIR => return error.FileNotFound,
.OPNOTSUPP => return error.OperationUnsupported,
.PERM => return error.PermissionDenied,
.ROFS => return error.ReadOnlyFileSystem,
else => |err| return unexpectedErrno(err),
}
}
}