From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26578 invoked by alias); 3 Jan 2006 23:54:11 -0000 Received: (qmail 26568 invoked by uid 22791); 3 Jan 2006 23:54:10 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jan 2006 23:54:08 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id k03Ns6CH015450 for ; Tue, 3 Jan 2006 18:54:06 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k03Ns5104558; Tue, 3 Jan 2006 18:54:05 -0500 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id k03Ns2sD009996; Tue, 3 Jan 2006 18:54:03 -0500 Message-ID: <43BB0E85.5050003@redhat.com> Date: Tue, 03 Jan 2006 23:54:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird (X11/20050322) MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sources.redhat.com, drow@false.org Subject: Re: [RFA] Linux Checkpoints, take 3 References: <43AC7D2E.6020609@redhat.com> <200512261533.jBQFXCwt001363@elgar.sibelius.xs4all.nl> In-Reply-To: <200512261533.jBQFXCwt001363@elgar.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00020.txt.bz2 Mark Kettenis wrote: > > >>+ /* Now save the 'state' (file position) of all open file descriptors. >>+ Unfortunately fork does not take care of that for us... */ > > > Hmm, fork(2) clones it file descroptors but both file descriptors > refer to the same open file description. Nasty. Wonder whether it'd > be possible to copy the open file descriptorions too. Well, I guess > the point was to do this without kernel support... This time around, anyway. I like the successive approximation approach. So much the better if, on the next pass, we can do even better by using kernel support. > Anyway, a few problems that I spotted: > > 1. Please drop the "extern" from _initialize_linux_fork() (and the > associated comment). You'll need an explicit prototype again, like: > > /* Prevent warning from -Wmissing-prototypes. */ > void _initialize_linux_fork (void); I don't understand the motivation, but OK. > 2. Please update the copyright notice to use (C) and the new FSF > address. Good catch, thanks. > 3. Replace the FORKS_EXISTS() macro with a forks_exists_p() function? > Or inline it if you don't think it's ever going to be changed. 'k. > 4. Aren't the values used for SEEK_SET/SEEK_CUR the same on all Linux > ports? In that case perhaps #defining LINUX_SEEK_SET 0, and using > LINUX_SEEK_SET would be a good solution. > > 5. Could you seperate out the "Detaching after fork from child > process" printing? Sorry, don't understand the request. > And from the nitpicking department: > > 1. The comments on the #includes are a bit silly. I'd rather not see > any unless there's something really unobvious going on. They get > out of data pretty soon anyway. Ooooook, sure... > 2. Please don't put the function name in comments above the function. > (call_lseek, linux_fork_killall, linux_fork_mourn_inferior, 'k... > 3. Really sorry to hear that you're suffering from a split personality > problem: > > >>2005-12-19 Michael Snyder >> >>2005-12-19 Michael Van Meter Snyder Well, that's life on the Information Superhighway... > Otherwise, I think it's ok. It's a bit sad that this is a Linux-only > implementation, but then it's mostly Linux-specific code. Well, it's intimately tied in with the linux follow-fork code. It should be possible to do something similar with other systems where follow-fork works -- but the only other one I'm aware of is hpux. > I'll see if > I can rig up something for OpenBSD, and then we can sort out what bits > are target-independent. If you can intercept the fork system call, it should be doable.