diff --git a/sysdata/libraries/stn/src/process.hb b/sysdata/libraries/stn/src/process.hb index 23bc4f1..498d1b3 100644 --- a/sysdata/libraries/stn/src/process.hb +++ b/sysdata/libraries/stn/src/process.hb @@ -3,6 +3,7 @@ $spawn := fn(proc_exe: ^u8, length: uint): uint { return @eca(3, 6, proc_exe, length) } +// returns: 0 if child process, child PID if parent process $fork := fn(): uint return @eca(3, 7) /* TODO: diff --git a/sysdata/programs/test/src/tests/stn/assets/lily.axe b/sysdata/programs/test/src/tests/stn/assets/lily.axe index ff23ae1..7c30ef3 100644 Binary files a/sysdata/programs/test/src/tests/stn/assets/lily.axe and b/sysdata/programs/test/src/tests/stn/assets/lily.axe differ diff --git a/sysdata/programs/test/src/tests/stn/process.hb b/sysdata/programs/test/src/tests/stn/process.hb index 86a7bfa..0f01c94 100644 --- a/sysdata/programs/test/src/tests/stn/process.hb +++ b/sysdata/programs/test/src/tests/stn/process.hb @@ -9,7 +9,11 @@ opaque := fn(ptr: ^bool): bool { return *ptr } +// axe := @embed("assets/lily.axe") + test := fn(): uint { + // process.spawn(@bitcast(&axe), @sizeof(@TypeOf(axe))) + a: ^bool = @bitcast(memory.request_page(1, true)) x := process.fork() log.info("both will print this") @@ -19,7 +23,7 @@ test := fn(): uint { // ! NOTE: NEVER DO THIS!!! USE BUFFERS INSTEAD!!! :) // acts as a lock. when parent is done, this can go ahead. loop if opaque(a) break else { - }; + } log.info("child done.") } else { *a = true