Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Threaded › chdir Public Function chdir Doc Source Public Function std.Io.Threaded.chdir
pub fn chdir (dir_path : []const u8 ) ChdirError !void Params File Io/Threaded.zig: 18338
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359 pub fn chdir (dir_path : []const u8 ) ChdirError !void {
var path_buffer : [posix .PATH_MAX ]u8 = undefined ;
const dir_path_posix = try pathToPosix (dir_path , &path_buffer );
const syscall : Syscall = try .start ();
while (true ) switch (posix .errno (posix .system .chdir (dir_path_posix ))) {
.SUCCESS => return syscall .finish (),
.INTR => {
try syscall .checkCancel ();
continue ;
},
.ACCES => return syscall .fail (error .AccessDenied ),
.IO => return syscall .fail (error .FileSystem ),
.LOOP => return syscall .fail (error .SymLinkLoop ),
.NAMETOOLONG => return syscall .fail (error .NameTooLong ),
.NOENT => return syscall .fail (error .FileNotFound ),
.NOMEM => return syscall .fail (error .SystemResources ),
.NOTDIR => return syscall .fail (error .NotDir ),
.ILSEQ => return syscall .fail (error .BadPathName ),
.FAULT => |err | return syscall .errnoBug (err ),
else => |err | return syscall .unexpectedErrno (err ),
};
}