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 › Uring › dirRealPathFile Private Function dirRealPathFile Doc Source Private Function std.Io.Uring.dirRealPathFile
fn dirRealPathFile (
userdata : ?*anyopaque ,
dir : Dir ,
sub_path : []const u8 ,
out_buffer : []u8 ,
) Dir .RealPathFileError !usize Params userdata : ?*anyopaque dir : Dir sub_path : []const u8 out_buffer : []u8 File Io/Uring.zig: 3167
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191 fn dirRealPathFile (
userdata : ?*anyopaque ,
dir : Dir ,
sub_path : []const u8 ,
out_buffer : []u8 ,
) Dir .RealPathFileError !usize {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
var path_buffer : [PATH_MAX ]u8 = undefined ;
const sub_path_posix = try pathToPosix (sub_path , &path_buffer );
var maybe_sync : CancelRegion .Sync .Maybe = .{ .cancel_region = .init () };
defer maybe_sync .deinit (ev );
const fd = ev .openat (&maybe_sync .cancel_region , dir .handle , sub_path_posix , .{
.CLOEXEC = true ,
.PATH = true ,
}, 0 ) catch |err | switch (err ) {
error .WouldBlock => return errnoBug (.AGAIN ),
error .OperationUnsupported => return errnoBug (.OPNOTSUPP ), // Not asking for locks.
error .ReadOnlyFileSystem => return errnoBug (.ROFS ), // Not creating.
else => |e | return e ,
};
defer ev .closeAsync (fd );
return ev .realPath (try maybe_sync .enterSync (ev ), fd , out_buffer );
}