From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh1qf-0004EQ-MG for qemu-devel@nongnu.org; Sat, 20 Sep 2008 08:46:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh1qe-0004Dy-6F for qemu-devel@nongnu.org; Sat, 20 Sep 2008 08:46:05 -0400 Received: from [199.232.76.173] (port=53313 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh1qe-0004Dv-1q for qemu-devel@nongnu.org; Sat, 20 Sep 2008 08:46:04 -0400 Received: from rv-out-0708.google.com ([209.85.198.243]:38989) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kh1qd-0003It-KL for qemu-devel@nongnu.org; Sat, 20 Sep 2008 08:46:03 -0400 Received: by rv-out-0708.google.com with SMTP id f25so716513rvb.22 for ; Sat, 20 Sep 2008 05:46:02 -0700 (PDT) Message-ID: Date: Sat, 20 Sep 2008 14:45:57 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH] Fix vfork() syscall emulation In-Reply-To: <20080920064556.GA24679@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1221750426-14863-1-git-send-email-kirill@shutemov.name> <20080920064556.GA24679@localhost.localdomain> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" Cc: qemu-devel@nongnu.org 2008/9/20 Kirill A. Shutemov : > 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 >> >> 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. Do you mean that's the current behavior in qemu? That's not what clone(2) says. > >> On the other hand the patch makes fork() and vfork() be treated identically? > > $ 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 Well, that's libc. clone with CLONE_VFORK and without it are still not the same thing. CLONE_VM and CLONE_VFORK are ortogonal to one another, not the opposite of. Cheers