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 › processReplace Private Function processReplace Doc Source Private Function std.Io.Uring.processReplace
fn processReplace (userdata : ?*anyopaque , options : process .ReplaceOptions ) process .ReplaceError Params userdata : ?*anyopaque options : process .ReplaceOptions File Io/Uring.zig: 4238
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264 fn processReplace (userdata : ?*anyopaque , options : process .ReplaceOptions ) process .ReplaceError {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
try ev .scanEnviron (); // for PATH
const PATH = ev .environ .string .PATH orelse default_PATH ;
var arena_allocator = std .heap .ArenaAllocator .init (ev .allocator ());
defer arena_allocator .deinit ();
const arena = arena_allocator .allocator ();
const argv_buf = try arena .allocSentinel (?[*:0 ]const u8 , options .argv .len , null );
for (options .argv , 0 ..) |arg , i | argv_buf [i ] = (try arena .dupeSentinel (u8 , arg , 0 )).ptr ;
const env_block = env_block : {
const prog_fd : i32 = -1 ;
if (options .environ_map ) |environ_map | break :env_block try environ_map .createPosixBlock (arena , .{
.zig_progress_fd = prog_fd ,
});
break :env_block try ev .environ .process_environ .createPosixBlock (arena , .{
.zig_progress_fd = prog_fd ,
});
};
var sync : CancelRegion .Sync = try .init (ev );
defer sync .deinit (ev );
return execv (&sync , options .expand_arg0 , argv_buf .ptr [0 ].?, argv_buf .ptr , env_block , PATH );
}