diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-24 09:54:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-24 09:54:44 +0000 |
commit | 30a150609eeb72e8df42859928918d56c54609da (patch) | |
tree | 2be0ee21e5a566ad8102f28213801d29d77f34b2 /sys/amd64 | |
parent | a539ffb3e757b7173722db6fec72f5079bdb4f3a (diff) | |
download | FreeBSD-src-30a150609eeb72e8df42859928918d56c54609da.zip FreeBSD-src-30a150609eeb72e8df42859928918d56c54609da.tar.gz |
Setup the return values for a child process in the trapframe when we setup
the rest of the trapframe instead of doing it in fork_return().
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 22625b2..232ac42 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -160,6 +160,10 @@ cpu_fork(p1, p2, flags) ((int)p2->p_addr + UPAGES * PAGE_SIZE - 16) - 1; bcopy(p1->p_md.md_regs, p2->p_md.md_regs, sizeof(*p2->p_md.md_regs)); + p2->p_md.md_regs->tf_eax = 0; /* Child returns zero */ + p2->p_md.md_regs->tf_eflags &= ~PSL_C; /* success */ + p2->p_md.md_regs->tf_edx = 1; + /* * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. |