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 › dirHardLink Private Function dirHardLink Doc Source Private Function std.Io.Uring.dirHardLink
fn dirHardLink (
userdata : ?*anyopaque ,
old_dir : Dir ,
old_sub_path : []const u8 ,
new_dir : Dir ,
new_sub_path : []const u8 ,
options : Dir .HardLinkOptions ,
) Dir .HardLinkError !void Params userdata : ?*anyopaque old_dir : Dir old_sub_path : []const u8 new_dir : Dir new_sub_path : []const u8 options : Dir .HardLinkOptions File Io/Uring.zig: 3555
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581 fn dirHardLink (
userdata : ?*anyopaque ,
old_dir : Dir ,
old_sub_path : []const u8 ,
new_dir : Dir ,
new_sub_path : []const u8 ,
options : Dir .HardLinkOptions ,
) Dir .HardLinkError !void {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
var old_path_buffer : [PATH_MAX ]u8 = undefined ;
var new_path_buffer : [PATH_MAX ]u8 = undefined ;
const old_sub_path_posix = try pathToPosix (old_sub_path , &old_path_buffer );
const new_sub_path_posix = try pathToPosix (new_sub_path , &new_path_buffer );
var cancel_region : CancelRegion = .init ();
defer cancel_region .deinit ();
return ev .linkat (
&cancel_region ,
old_dir .handle ,
old_sub_path_posix ,
new_dir .handle ,
new_sub_path_posix ,
if (options .follow_symlinks ) linux .AT .SYMLINK_FOLLOW else 0 ,
);
}