Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* linux-proc readlink patch
@ 2002-01-09 12:15 Daniel Jacobowitz
  2002-01-09 12:51 ` Andrew Cagney
  2002-01-09 14:24 ` Michael Snyder
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-01-09 12:15 UTC (permalink / raw)
  To: gdb-patches, msnyder

This patch:

2002-01-08  Michael Snyder  <msnyder@redhat.com>

        * linux-proc.c (child_pid_to_exec_file): Use readlink to get the
        real name of the executable, rather than the /proc name.

(which I never saw posted on gdb-patches; was that an artifact of the email
breakage yesterday?)

seems to have at least one problem.

(1) It introduces a memory leak, if I understand the semantics of cleanups
correctly.  make_cleanup's cleanups will only be called (according to the
comment in utils.c) after a failed command.

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

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


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: linux-proc readlink patch
@ 2002-01-10  7:56 Michael Elizabeth Chastain
  2002-01-10  9:32 ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2002-01-10  7:56 UTC (permalink / raw)
  To: drow, kevinb; +Cc: gdb-patches, msnyder

Daniel Jacobowitz writes:
> 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.

I'm getting a nostalgia rush.

My recollection is the same as Daniel's.  /proc/$pid/exe has been a
symlink for a long time, since 1996 or so.  And it's been usable all
that time if you just open up the file and use it.

The original name was indeed "device:inode" which was unusable.  I don't
know when the transitition to a real file name took place.  The last
two stable versions of the kernel (2.2 and 2.4) have real file names
instead of "device:inode" and I feel comfortable relying on a feature
that is in the past two major versions.

Michael C


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-01-10 17:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-09 12:15 linux-proc readlink patch Daniel Jacobowitz
2002-01-09 12:51 ` Andrew Cagney
2002-01-09 14:24 ` Michael Snyder
2002-01-09 15:09   ` Daniel Jacobowitz
2002-01-09 15:40     ` Kevin Buettner
2002-01-09 15:45       ` Daniel Jacobowitz
2002-01-10  7:56 Michael Elizabeth Chastain
2002-01-10  9:32 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox