From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgwDT-00027X-SN for qemu-devel@nongnu.org; Sat, 20 Sep 2008 02:45:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgwDR-00027L-ED for qemu-devel@nongnu.org; Sat, 20 Sep 2008 02:45:14 -0400 Received: from [199.232.76.173] (port=59945 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgwDR-00027I-9j for qemu-devel@nongnu.org; Sat, 20 Sep 2008 02:45:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:10185) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgwDQ-0004H1-Uo for qemu-devel@nongnu.org; Sat, 20 Sep 2008 02:45:13 -0400 Received: from ey-out-1920.google.com ([74.125.78.146]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KgwDP-00040B-Ml for qemu-devel@nongnu.org; Sat, 20 Sep 2008 02:45:11 -0400 Received: by ey-out-1920.google.com with SMTP id 4so219567eyk.4 for ; Fri, 19 Sep 2008 23:45:10 -0700 (PDT) Date: Sat, 20 Sep 2008 09:45:57 +0300 From: "Kirill A. Shutemov" Subject: Re: [Qemu-devel] [PATCH] Fix vfork() syscall emulation Message-ID: <20080920064556.GA24679@localhost.localdomain> References: <1221750426-14863-1-git-send-email-kirill@shutemov.name> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrzej zaborowski Cc: qemu-devel@nongnu.org --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 20, 2008 at 04:56:45AM +0200, andrzej zaborowski wrote: > 2008/9/18 Kirill A. Shutemov : > > vfork() is a kind of fork, not thread despite CLONE_VM >=20 > According to clone(2) it can be either, the only difference is that > vfork() suspends the parent process. So if CLONE_VM is set, I think > still the pthread / clone way should be used and the child thread > should be waited on. vfork() suspends the parent process until a call of execve(2) or _exit(2). If child call execnv(2) it replaces whole process, not only the thread. If child call _exit(2) it stops while process, not only the thread. > On the other hand the patch makes fork() and vfork() be treated identical= ly? $ cat usr/klibc/vfork.c /* * vfork.c * * Emulate vfork() with fork() if necessary */ #include #include #include #if !_KLIBC_NO_MMU && !_KLIBC_REAL_VFORK int vfork(void) { return fork(); } #endif --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/ --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkjUnCMACgkQbWYnhzC5v6oxBgCfVszZQlX63OaP0hxWqa+B2hCU DtsAnRhKdmOyKQV21dKTiWeHy02qHPhf =Waq6 -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--