David Gonzalez Martin 8e4fc03d1b Modernize std API
2024-03-08 16:35:40 -06:00

13 lines
406 B
Plaintext

const std = #import("std");
const main = fn() *!void {
const pid = try std.os.duplicate_process();
if (pid == 0) {
std.print(bytes = "Hello from child\n");
const argv = [_:null] ?[&:0]const u8{"/usr/bin/ls"};
try std.os.execute(path = "/usr/bin/ls", argv = argv.&, env = std.start.environment_values);
} else {
std.print(bytes = "Hello from parent\n");
}
}