From a74bedbb5d40c1d0a254fc6be50db0aeff3cc7f2 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Mon, 9 Feb 2004 19:14:28 +0000 Subject: duh. there are two syscall entry points and both have to preserve rdx. also make sure child process gets 1 in rdx as libc expects --- sys/arch/amd64/amd64/syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c index 05f2b61479c..b8fc478e06b 100644 --- a/sys/arch/amd64/amd64/syscall.c +++ b/sys/arch/amd64/amd64/syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.c,v 1.3 2004/02/09 14:11:09 mickey Exp $ */ +/* $OpenBSD: syscall.c,v 1.4 2004/02/09 19:14:27 mickey Exp $ */ /* $NetBSD: syscall.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */ /*- @@ -273,7 +273,7 @@ syscall_fancy(frame) #endif rval[0] = 0; - rval[1] = 0; + rval[1] = frame.tf_rdx; #if NSYSTRACE > 0 if (ISSET(p->p_flag, P_SYSTRACE)) error = systrace_redirect(code, p, args, rval); @@ -326,6 +326,7 @@ child_return(void *arg) struct trapframe *tf = p->p_md.md_regs; tf->tf_rax = 0; + tf->tf_rdx = 1; tf->tf_rflags &= ~PSL_C; KERNEL_PROC_UNLOCK(l); -- cgit v1.2.3