Split processctl() syscall into multiple smaller ones

This commit is contained in:
2025-10-14 16:37:36 +02:00
parent 8aec45316c
commit c34a253d11
22 changed files with 359 additions and 236 deletions

View File

@ -111,7 +111,7 @@ bool rt_do(Token *tks) {
args1[ARRLEN(prepended_args)] = umalloc(PROC_ARG_MAX);
string_strcpy(args1[ARRLEN(prepended_args)], s);
int32_t app = processctl(-1, PCTL_SPAWN, (uint64_t)"base:/bin/tb", (uint64_t)args1, ARRLEN(prepended_args)+1);
int32_t app = proc_spawn("base:/bin/tb", args1, ARRLEN(prepended_args)+1);
if (app < 0) {
ok = false;
goto done;
@ -123,9 +123,9 @@ bool rt_do(Token *tks) {
ipc_pipemake(10);
ipc_pipeconnect(app, 0, PID, 10);
processctl(app, PCTL_RUN, 0, 0, 0);
proc_run(app);
while (processctl(app, PCTL_POLLSTATE, 0, 0, 0) != 4) {
while (proc_pollstate(app) != 4) {
int32_t r;
char buf[100];
string_memset(buf, 0, sizeof(buf));