From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh3aU-0005Qp-98 for qemu-devel@nongnu.org; Sat, 20 Sep 2008 10:37:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh3aS-0005PK-CE for qemu-devel@nongnu.org; Sat, 20 Sep 2008 10:37:29 -0400 Received: from [199.232.76.173] (port=58832 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh3aQ-0005Ou-Py for qemu-devel@nongnu.org; Sat, 20 Sep 2008 10:37:26 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:20237) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kh3aQ-0006y9-8f for qemu-devel@nongnu.org; Sat, 20 Sep 2008 10:37:26 -0400 Received: by nf-out-0910.google.com with SMTP id b2so447177nfb.12 for ; Sat, 20 Sep 2008 07:37:25 -0700 (PDT) Date: Sat, 20 Sep 2008 17:38:12 +0300 From: "Kirill A. Shutemov" Subject: Re: [Qemu-devel] [PATCH] Fix vfork() syscall emulation Message-ID: <20080920143810.GA27421@localhost.localdomain> References: <1221750426-14863-1-git-send-email-kirill@shutemov.name> <20080920064556.GA24679@localhost.localdomain> <20080920131134.GA26850@localhost.localdomain> <20080920142051.GA27083@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" 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, Paul Brook --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 20, 2008 at 04:35:25PM +0200, andrzej zaborowski wrote: > 2008/9/20 Kirill A. Shutemov : > > On Sat, Sep 20, 2008 at 03:52:55PM +0200, andrzej zaborowski wrote: > >> 2008/9/20 Kirill A. Shutemov : > >> > So, implementation vfork() using pthread is wrong. > >> > >> Agreed, but implementation of vfork() using fork() is wrong, too. > > > > Why? > > > > man 2 vfork(): > > > > BUGS > > It is rather unfortunate that Linux revived this specter from= the > > past. The BSD man page states: "This system call will be elimin= ated > > when proper system sharing mechanisms are implemented. Users sh= ould > > not depend on the memory sharing semantics of vfork() as it will,= in > > that case, be made synonymous to fork(2)." > > > > If any program doesn't work with vfork() implemented using fork(). it's > > program bug. > > > > > >> If > >> we allow a hack, it should be commented, the second thing that needs > >> to be commented is why the value of CLONE_VM flag is ignored if > >> CLONE_VFORK is set -- on Linux it's not ignored. > > > > vfork() is a hack itself. It was introduced when fork() was very expens= ive. >=20 > Ok, perhaps I'm nit picking. clone(2) specifies some semantics for > CLONE_VFORK regardless of the purpose and this implementation is > nowhere near these semantics. I'll just add the same comment that > klibc has and push the patch. Thanks! --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/ --XsQoSWH+UP9D9v3l 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) iEYEARECAAYFAkjVCtIACgkQbWYnhzC5v6pbSwCfWP1JqQHhyVx9QcxZJp//RlkU DycAoJHI98jeQDJFUHL5dIkikZ0ubjPm =LPiA -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--