Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!gatech!emory!arnold From: arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) Newsgroups: comp.lang.c Subject: Re: Re^2: Functions pointers and stuff. Message-ID: <3863@emory.mathcs.emory.edu> Date: 31 Mar 89 17:14:38 GMT References: <1715@leah.Albany.Edu> <3182@goofy.megatest.UUCP> <301@oha.UUCP> <302@oha.UUCP> <1079@vsi.COM> Reply-To: arnold@emory.UUCP (Arnold D. Robbins {EUCC}) Organization: Emory University Lines: 28 This thread started with a question about mapping names in strings to function addresses. In article <1079@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: >When Sys V Rel 4 comes out, you'll be able to get a file descriptor >to your own executable with an ioctl on a /proc/##### file, where >##### is your pid. If there is a symbol table there you will be able >to reliably map a function name to an address at runtime. > >/proc is really cool. Agreed, /proc is cool. Unfortunately, nlist(3) takes a path name, and not a file descriptor. There is a way around it, but what I want to know is if it will be in SVR4. I have in mind using /dev/fd, like so: sprintf (myproc, "/proc/%05d", getpid()); myprocfd = open (myproc, O_RDONLY); myimage = ioctl (myprocfd, PROC_GETIMAGEFD /* or whatever */, 0); sprintf (imagename, "/dev/fd/%d", myimage); nlist (imagename, nl); .... or will there be a new version of nlist? -- Unix is a Registered | Arnold Robbins -- Emory University Computing Center Bell of AT&T Trademark | DOMAIN: arnold@unix.cc.emory.edu Laboratories. | UUCP: gatech!emory!arnold PHONE: +1 404 727-7636 -- Donn Seeley | BITNET: arnold@emoryu1 FAX: +1 404 727-2599