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 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.

Kevin


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