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 › dirSymLinkPosix Private Function dirSymLinkPosix Doc Source Private Function std.Io.Threaded.dirSymLinkPosix
fn dirSymLinkPosix (
userdata : ?*anyopaque ,
dir : Dir ,
target_path : []const u8 ,
sym_link_path : []const u8 ,
flags : Dir .SymLinkFlags ,
) Dir .SymLinkError !void Params userdata : ?*anyopaque dir : Dir target_path : []const u8 sym_link_path : []const u8 flags : Dir .SymLinkFlags File Io/Threaded.zig: 8148
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196 fn dirSymLinkPosix (
userdata : ?*anyopaque ,
dir : Dir ,
target_path : []const u8 ,
sym_link_path : []const u8 ,
flags : Dir .SymLinkFlags ,
) Dir .SymLinkError !void {
_ = flags ;
const t : *Threaded = @ptrCast (@alignCast (userdata ));
_ = t ;
var target_path_buffer : [posix .PATH_MAX ]u8 = undefined ;
var sym_link_path_buffer : [posix .PATH_MAX ]u8 = undefined ;
const target_path_posix = try pathToPosix (target_path , &target_path_buffer );
const sym_link_path_posix = try pathToPosix (sym_link_path , &sym_link_path_buffer );
const syscall : Syscall = try .start ();
while (true ) {
switch (posix .errno (posix .system .symlinkat (target_path_posix , dir .handle , sym_link_path_posix ))) {
.SUCCESS => return syscall .finish (),
.INTR => {
try syscall .checkCancel ();
continue ;
},
else => |e | {
syscall .finish ();
switch (e ) {
.FAULT => |err | return errnoBug (err ),
.INVAL => |err | return errnoBug (err ),
.ACCES => return error .AccessDenied ,
.PERM => return error .PermissionDenied ,
.DQUOT => return error .DiskQuota ,
.EXIST => return error .PathAlreadyExists ,
.IO => return error .FileSystem ,
.LOOP => return error .SymLinkLoop ,
.NAMETOOLONG => return error .NameTooLong ,
.NOENT => return error .FileNotFound ,
.NOTDIR => return error .NotDir ,
.NOMEM => return error .SystemResources ,
.NOSPC => return error .NoSpaceLeft ,
.ROFS => return error .ReadOnlyFileSystem ,
.ILSEQ => return error .BadPathName ,
else => |err | return posix .unexpectedErrno (err ),
}
},
}
}
}