This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linux-proc readlink patch


On Wed, Jan 09, 2002 at 04:40:12PM -0700, Kevin Buettner wrote:
> On Jan 9,  6:10pm, Daniel Jacobowitz wrote:
> 
> > On Wed, Jan 09, 2002 at 02:18:53PM -0800, Michael Snyder wrote:
> > > Nope, that's not the semantics.  Cleanups are always done, no later than
> > > when the command is finished executing (if not earlier).  I even checked
> > > to make sure that these were done.  There's no memory leak.
> > 
> > Well, the comments in utils.c are wrong, then :)
> > 
> > > > (2) It is not, IIRC, always correct in the case of chroots.  Handling for
> > > > this has changed across Linux versions several times.  On 2.2 it seems to be
> > > > correct (to my surprise, actually), but I believe it is not on 2.0.  Do we
> > > > care?  Probably not, as 2.0 is now -very- old.
> > > 
> > > Well, if it fails, the code falls back to using the original /proc name.
> > 
> > By fails, I meant that the output of readlink was not useful.  But I
> > don't think this is a concern.
> 
> So the link was just wrong?  If so, then opening /proc/<pid>/exe won't work
> either, right?
> 
> If these old kernels managed to somehow open the right file but provide
> an incorrect link via readlink(), I suppose we could stat() the file
> to see if it exists.

The link was 'magic' - its text was something along the lines of a
device and inode number, I believe.  It's not worth worrying about
unless someone actually reports it broken, I think.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]