Path: utzoo!utgpu!watmath!att!dptg!rutgers!iuvax!mailrus!cornell!uw-beaver!uw-june!bcn From: bcn@cs.washington.edu (Clifford Neuman) Newsgroups: comp.unix.wizards Subject: Reading the symbol table of the currently running executable Message-ID: <9104@june.cs.washington.edu> Date: 30 Aug 89 20:22:32 GMT Organization: U of Washington, Computer Science, Seattle Lines: 26 Does anyone know how to read the symbol table of a program from within that program itself? More precisely, from within a procedure in a library which was used in linking the executable. The simplest way is to read the symbol table from the executable. Unfortunately, I might not know the name of the executable. I can solve my problem in any of several ways, and I would appreciate suggested solutions to any of these problems. 1) Directly reading the symbol table from within the running program 2) Obtaining the full path name of the presently running executable. Remember, argv[0] will not contain the full path if the executable was found through the search path. Also, the program may have been started by execl with an argv[0] that is unrelated to the file name. 3) Obtaining a file descriptor for the currently running executable (i.e. I don't need the name as long as I can read it). Please respond to me directly since I do not normally read this list. I will summarize any personal responses I receive. Thanks, ~ Cliff PS: I am presently using a Vax running Ultrix 3.0, but I will will ultimately need to do this under other versions of Unix as well.