Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!buddy.Berkeley.EDU!deboor From: deboor@buddy.Berkeley.EDU (Adam R de Boor) Newsgroups: comp.unix.wizards Subject: Re: Reading the symbol table of the currently running executable Message-ID: <16815@pasteur.Berkeley.EDU> Date: 3 Sep 89 23:02:35 GMT References: <9104@june.cs.washington.edu> <679@lakart.UUCP> Sender: news@pasteur.Berkeley.EDU Reply-To: deboor@buddy.Berkeley.EDU.UUCP (Adam R de Boor) Organization: University of California, Berkeley Lines: 14 Wrong. The core file doesn't contain the symbol table. The way I've always handled things of this nature is to use argv[0] and look for an executable file of the same name along $PATH. Useful also for having a configuration file that resides in the same directory as the executable, but they both can be wherever one wants them to be. True, this plan does have a few flaws (you have to have argv[0]), but you're not going to get anywhere via /dev/mem short of locating the text-table entry for the process in the kernel, reading the inode structure to obtain the inode number, then looking through the filesystem (or $PATH again :) for a file with that number... a