Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!bloom-beacon!apple!rutgers!att!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.c Subject: Re^2: Functions pointers and stuff. Message-ID: <302@oha.UUCP> Date: 30 Mar 89 13:34:34 GMT References: <1715@leah.Albany.Edu> <3182@goofy.megatest.UUCP> <301@oha.UUCP> <1989Mar29.204918.3882@utzoo.uucp> Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada Lines: 26 In article <301@oha.UUCP> tony@oha.UUCP (me) wrote: >And from the SVID (quasi-portable, if you have SV or Xenix or ?): ... > if (nlist(*argv, nameinfo) == -1) { and in article <1989Mar29.204918.3882@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) wrote: > > The problem here is the assumption that argv[0] is a full pathname for > the program. In general it's not, and finding the binary is not a > trivial exercise. Henry is, of course, completely correct, so two things are possible: a) Hand code the name to address mapping as a structure array, which is what I do with production code. This was already mentioned by the poster of the original question, who was asking for other ways. b) Deliberately make the name of the binary known during the installation process, and check the consistency of this information at run-time. This is an alternative which meets the needs set out in the original posting. Perhaps this is one for a future addition to C? I'd suggest a syntax, but the snow is already melting here without any help from the net ;-) Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).