Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 1998 11:46:57 -0400 (EDT)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        committers@freebsd.org
Subject:   src/lib/libc/i386/sys/Ovfork.S
Message-ID:  <199809131546.LAA06774@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
I was looking at Ovfork.S today and I saw some problem with the code. Another
instance of the common cut 'n paste mistakes, I suppose.

-lq

ENTRY(vfork)
	popl	%ecx		/* my rta into ecx */
	^^^^^^^^^^^^		<== store return address in %ecx
	lea	SYS_vfork,%eax
	KERNCALL
	jb	verror
vforkok:
	cmpl	$0,%edx		/* child process? */
	jne	child		/* yes */
	jmp 	parent 

	.globl	CNAME(__error)
	.type	CNAME(__error),@function
verror:
	pushl	%eax
#ifdef PIC
	call	PIC_PLT(CNAME(__error))
#else
	call	CNAME(__error)
#endif
	popl	%ecx
	^^^^^^^^^^^^		<== errno, overwrite return address
	movl	%ecx,(%eax)
	movl	$-1,%eax
	movl	$-1,%edx
	jmp	%ecx
	^^^^^^^^^^^^		<== jump to errno?
child:
	movl	$0,%eax
parent:
	jmp	%ecx




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809131546.LAA06774>