Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 13:43:53 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        arch@FreeBSD.ORG, Jake Burkholder <jake@locore.ca>
Subject:   Re: syscall() ABI questions
Message-ID:  <XFMail.011029134353.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0110291255300.26174-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 29-Oct-01 Julian Elischer wrote:
> But the API for vfork forbids the child from doing a 'ret' after the vfork
> returns.. if it does that, all bets are off.... you can do: 
> vfork();
> exec();
> 
> and that 's about all that's ok...
> I'm not even sure about 
> vfork();
> exit();

Jake is talking about the return from the actual vfork() wrapper in libc for
the syscall.  We have to return from that. :)  So we do that by saving the
return address in a register and adjusting the stack before return in case the
child clobbers that part of the stack we can restore it for the parent.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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