From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3900 invoked by alias); 9 Jul 2008 07:56:17 -0000 Received: (qmail 3887 invoked by uid 22791); 9 Jul 2008 07:56:16 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 09 Jul 2008 07:55:59 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m696QKE2014574; Wed, 9 Jul 2008 08:26:20 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m696QIcD010586; Wed, 9 Jul 2008 08:26:18 +0200 (CEST) Date: Wed, 09 Jul 2008 07:56:00 -0000 Message-Id: <200807090626.m696QIcD010586@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: msnyder@specifix.com CC: drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org In-reply-to: <1215573936.3549.126.camel@localhost.localdomain> (message from Michael Snyder on Tue, 08 Jul 2008 20:25:36 -0700) Subject: Re: [non-stop] 08/10 linux native support References: <200806152205.49241.pedro@codesourcery.com> <200806252217.25796.pedro@codesourcery.com> <20080625221220.GB5723@caradoc.them.org> <200807020434.50543.pedro@codesourcery.com> <20080707182009.GE1778@caradoc.them.org> <1215573936.3549.126.camel@localhost.localdomain> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00127.txt.bz2 > From: Michael Snyder > Date: Tue, 08 Jul 2008 20:25:36 -0700 > > On Mon, 2008-07-07 at 14:20 -0400, Daniel Jacobowitz wrote: > > On Wed, Jul 02, 2008 at 04:34:50AM +0100, Pedro Alves wrote: > > > @@ -337,7 +337,9 @@ linux_fork_killall (void) > > > { > > > pid = PIDGET (fp->ptid); > > > do { > > > - ptrace (PT_KILL, pid, 0, 0); > > > + /* Use SIGKILL instead of PTRACE_KILL because the former works even > > > + if the thread is running, while the later doesn't. */ > > > + kill (pid, SIGKILL); > > > ret = waitpid (pid, &status, 0); > > > /* We might get a SIGCHLD instead of an exit status. This is > > > aggravated by the first kill above - a child has just > > > > This is OK but if anyone wants to make fork support handle > > multi-threaded programs someday we may need to expose kill_lwp. > > Fork is undefined in a multi-threaded program. No it's not. It's supposed to fork only the running thread, that is, you get a copy of the vm space withe a single thread in it whose initial state is a copy of the state of the thread executing fork. Some OS'es offer an alternative fork that forks all running threads but it is non-standard.