From ff859b8e0c72910aa1b7635c839642fcfb9c1c8a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 5 Oct 2025 19:18:14 -0400 Subject: kern: syscall: Add initial SYS_spawn syscall Signed-off-by: Ian Moffett --- src/sys/os/os_proc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sys/os') diff --git a/src/sys/os/os_proc.c b/src/sys/os/os_proc.c index e32e59c..14f8ceb 100644 --- a/src/sys/os/os_proc.c +++ b/src/sys/os/os_proc.c @@ -212,3 +212,18 @@ proc_spawn(const char *path, struct penv_blk *envbp) sched_enq(&core->scq, proc); return proc->pid; } + +scret_t +sys_spawn(struct syscall_args *scargs) +{ + const char *u_path = SCARG(scargs, const char *, 0); + char buf[PATH_MAX]; + int error; + + error = copyinstr(u_path, buf, sizeof(buf)); + if (error < 0) { + return error; + } + + return proc_spawn(buf, NULL); +} -- cgit v1.2.3