diff options
author | Ian Moffett <ian@osmora.org> | 2024-06-30 23:57:39 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-01 00:01:41 -0400 |
commit | 5ab0c12d54e7f47a64b476d41a7ed15104f79f5c (patch) | |
tree | f659411bb964561c9b5cea780b9c503332711fd1 /sys/include | |
parent | a0540658f66feb32c1abe71d9d7589b854e9aaa5 (diff) |
kernel: exec: Add execve()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/sys/exec.h | 8 | ||||
-rw-r--r-- | sys/include/sys/proc.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/include/sys/exec.h b/sys/include/sys/exec.h index 73eae01..f5fac97 100644 --- a/sys/include/sys/exec.h +++ b/sys/include/sys/exec.h @@ -72,7 +72,15 @@ struct exec_prog { char **envp; }; +struct execve_args { + const char *pathname; + char **argv; + char **envp; +}; + +int execve(struct proc *td, const struct execve_args *args); int elf64_load(const char *pathname, struct proc *td, struct exec_prog *prog); + void elf_unload(struct proc *td, struct exec_prog *prog); void setregs(struct proc *td, struct exec_prog *prog, uintptr_t stack); diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h index 0c3cd33..ba931f3 100644 --- a/sys/include/sys/proc.h +++ b/sys/include/sys/proc.h @@ -56,6 +56,8 @@ struct proc { }; #define PROC_EXITING BIT(0) /* Exiting */ +#define PROC_EXEC BIT(1) /* Exec called (cleared by sched) */ +#define PROC_INEXEC BIT(2) /* Exec in progress */ struct proc *this_td(void); int md_fork(struct proc *p, struct proc *parent, uintptr_t ip); |