fn fchdir(sync: *CancelRegion.Sync, dir: fd_t) process.SetCurrentDirError!void
fn fchdir(sync: *CancelRegion.Sync, dir: fd_t) process.SetCurrentDirError!void { if (dir == linux.AT.FDCWD) return; while (true) { try sync.cancel_region.await(.nothing); switch (linux.errno(linux.fchdir(dir))) { .SUCCESS => return, .INTR => {}, .ACCES => return error.AccessDenied, .NOTDIR => return error.NotDir, .IO => return error.FileSystem, .BADF => |err| return errnoBug(err), else => |err| return unexpectedErrno(err), } } }