13 lines
406 B
Plaintext
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");
|
|
}
|
|
}
|