Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!ugfailau From: ugfailau@sunybcs.uucp (Fai Lau) Newsgroups: comp.unix.questions Subject: Re: How does a program get its path name? Message-ID: <8722@sunybcs.UUCP> Date: 21 Feb 88 17:41:13 GMT References: <11923@brl-adm.ARPA> <7304@brl-smoke.ARPA> <7102@agate.BERKELEY.EDU> Sender: nobody@sunybcs.UUCP Reply-To: ugfailau@joey.UUCP (Fai Lau) Organization: SUNY/Buffalo Computer Science Lines: 25 In article <7102@agate.BERKELEY.EDU> shipley@widow.berkeley.edu (Peter Shipley) writes: >In article <7304@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >> >>That information is not generally available to the process. >> >>I don't know of any "cc"s that work like that. Usually the pathnames >>of the slave programs are hard-wired into the "cc" code, although >>they're sometimes configurable via the makefile for cc when it's built. > >I thought that the path came from the user's environment >variable PATH. > The environmental variable enables the SHELL to find a file, not for a file to find another file. An executable, however, can be hard coded to use the envirnomental path specifically, or be hard coded to find a file through a specific path, however. It all depends on the program itself. The discussion's focus is on how cc.c knows that all the slave programs are in /lib. And the explanation is that the path plus the name of the slave programs themselves are hard coded (defined as pointers) in cc.c. Fai Lau SUNY at Buffalo (The Arctic Wonderland) UU: ..{rutgers,ames}!sunybcs!ugfailau BI: ugfailau@sunybcs INT: ugfailau@joey.cs.buffalo.EDU