diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-03-31 04:32:03 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-03-31 04:32:03 +0000 |
commit | 086157d1e3625c713abad9d6345358ede7b96218 (patch) | |
tree | 6b505aa6a76935423ed18be22a36b5960cb385c0 /lib/libc/arch/i386 | |
parent | 38a3209966177abac13e955fc570f7fa57312ce0 (diff) |
Simplify fork/vfork logic: the kernel has handled returning zero in the child
for a long time, so there's no need to test the second return register here
in the asm stub.
ok and testing of many archs by krw@ miod@
Diffstat (limited to 'lib/libc/arch/i386')
-rw-r--r-- | lib/libc/arch/i386/sys/Ovfork.S | 11 | ||||
-rw-r--r-- | lib/libc/arch/i386/sys/fork.S | 7 |
2 files changed, 3 insertions, 15 deletions
diff --git a/lib/libc/arch/i386/sys/Ovfork.S b/lib/libc/arch/i386/sys/Ovfork.S index 984c26c3cb0..aad09330695 100644 --- a/lib/libc/arch/i386/sys/Ovfork.S +++ b/lib/libc/arch/i386/sys/Ovfork.S @@ -1,4 +1,4 @@ -/* $OpenBSD: Ovfork.S,v 1.7 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: Ovfork.S,v 1.8 2015/03/31 04:32:01 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -33,20 +33,11 @@ #include "SYS.h" -/* - * pid = vfork(); - * - * %edx == 0 in parent process, %edx == 1 in child process. - * %eax == pid of child in parent, %eax == pid of parent in child. - * - */ SYSENTRY(vfork) popl %ecx /* my rta into ecx */ movl $(SYS_vfork),%eax int $0x80 jc err - decl %edx - andl %edx,%eax jmp *%ecx err: #ifdef __PIC__ diff --git a/lib/libc/arch/i386/sys/fork.S b/lib/libc/arch/i386/sys/fork.S index e8850dd5b5c..205ae5942c1 100644 --- a/lib/libc/arch/i386/sys/fork.S +++ b/lib/libc/arch/i386/sys/fork.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fork.S,v 1.4 2005/08/07 11:30:38 espie Exp $ */ +/* $OpenBSD: fork.S,v 1.5 2015/03/31 04:32:01 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -33,7 +33,4 @@ #include "SYS.h" -SYSCALL(fork) - decl %edx /* from 1 to 0 in child, 0 to -1 in parent */ - andl %edx,%eax - ret /* pid = fork(); */ +RSYSCALL(fork) |