aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 1466159..ceb08f6 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -36,6 +36,7 @@
#include <vm/map.h>
#include <vm/physmem.h>
#include <machine/pcb.h>
+#include <string.h>
/*
* Release the memory of the old stack
@@ -84,6 +85,9 @@ execve(struct proc *td, const struct execve_args *args)
if (td->stack_base != 0)
release_stack(td);
+ /* Save program state */
+ memcpy(&td->exec, &prog, sizeof(td->exec));
+
/* Set new stack and map it to userspace */
td->stack_base = stack;
vm_map(pcbp->addrsp, td->stack_base, td->stack_base,