Pass arguments to main via runtime.process.Init, dispatched on signature
This commit is contained in:
@@ -48,10 +48,8 @@ fn awaitChildExit(endpoint: runtime.ipc.Handle) u32 {
|
||||
return received.childProcessId();
|
||||
}
|
||||
|
||||
pub fn main() void {
|
||||
if (runtime.argumentCount() <= 1) return; // spawned bare (ramdisk sweep): stay silent
|
||||
|
||||
const role = runtime.argument(1);
|
||||
pub fn main(init: runtime.process.Init) void {
|
||||
const role = init.arguments.get(1) orelse return; // spawned bare (ramdisk sweep): stay silent
|
||||
if (std.mem.eql(u8, role, "sleeper")) {
|
||||
while (true) runtime.system.sleep(500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user