How does a program get its path name?

Fai Lau ugfailau at sunybcs.uucp
Mon Feb 22 03:41:13 AEST 1988


In article <7102 at agate.BERKELEY.EDU> shipley at widow.berkeley.edu (Peter Shipley) writes:
>In article <7304 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) 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 at sunybcs INT: ugfailau at joey.cs.buffalo.EDU



More information about the Comp.unix.questions mailing list