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 library itself.
Zig › std/ › Io/ › Uring.zig › processReplace
processReplace
Uring.processReplace
fn processReplace (userdata : ?*anyopaque , options : process .ReplaceOptions ) process .ReplaceError
File
Code
fn processReplace (userdata : ?*anyopaque , options : process .ReplaceOptions ) process .ReplaceError {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
try ev .scanEnviron ();
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 );
}