Date: Thu, 19 Nov 2009 16:07:38 +0100 From: Attilio Rao <attilio@freebsd.org> To: "Robert N. M. Watson" <rwatson@freebsd.org> Cc: freebsd-current@freebsd.org, Ed Maste <emaste@freebsd.org> Subject: Re: [PATCH] Let gcore use ptrace interface rather than the procfs Message-ID: <3bbf2fe10911190707w63d1ab66pa2014c526342f68e@mail.gmail.com> In-Reply-To: <645CAAD7-A3BE-44B3-97D5-F4E4786943A4@freebsd.org> References: <3bbf2fe10911160718j7784b311g2980aa02c79bc9ec@mail.gmail.com> <alpine.BSF.2.00.0911171120050.47035@fledge.watson.org> <20091117141713.GA51251@sandvine.com> <9C740225-CB30-4D26-8E4B-F9D5DC51B899@FreeBSD.org> <3bbf2fe10911181733j598083feiddf3d4b34d0007d6@mail.gmail.com> <alpine.BSF.2.00.0911190757430.12162@fledge.watson.org> <3bbf2fe10911190545l264c0e2s615034999f46bc0a@mail.gmail.com> <645CAAD7-A3BE-44B3-97D5-F4E4786943A4@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
2009/11/19 Robert N. M. Watson <rwatson@freebsd.org>: > > On 19 Nov 2009, at 13:45, Attilio Rao wrote: > >>> If you add the missing include of sys/wait.h, elfcore.c generates an er= ror >>> instead of a warning on this non-traditional use of wait(2): >>> >>> + wait(); >>> >>> Something like this may be preferred: >>> >>> if (waitpid(pid, NULL, 0) < 0) >>> err(1, "waitpid"); >> >> I didn't get a warning neither an error but yes, the waitpid() is >> preferred and should be used. > > This warning was on i386 9.x, FYI, and was a property of failing to call = wait(2) with an argument. > >>> I think that kills the last of the procfs dependencies, in which case >>> perhaps we can remove the procfs.h include from elfcore.c, which requir= es >>> defining a local version of a summary data structure borrowed from proc= fs. >>> It's worth trying with procfs unmounted, however, to make sure they're >>> really all gone (which is how I ran into the above problem). >> >> I don't like the idea to replicate the structures because of code >> maintence. IMHO is ok to have procfs header. > > > I'm not sure I agree; looking at the elfcore code, it looks like it goes = to some amount of inconvenience to stuff things into the structure in the f= irst place, primarily because that was how procfs exported it. With your ex= cellent change, there's no need for gcore(1) to depend on procfs-specific d= ata structures that may change, or more ideally, be removed in the future. Yeah, I had the same feeling as the interfaces should be more lifted in order to less fit procfs (example: probabilly readmap could export directly the list of objects from libutil rather then transforming it) but let's get there in a second round of changes probabilly. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10911190707w63d1ab66pa2014c526342f68e>