Finding where an executable was run from -- a proposal.

Brent Callaghan brent%terra at Sun.COM
Sun May 15 14:01:13 AEST 1988


I think the most useful and "right" way to do this would be to
add another inode/vnode to the process u-area.  At the moment
Unix requires two: one for the current root (changeable with
chroot()) and one for the current working directory (changeable
with chdir()).

The extra inode would represent the directory that the
process was exec-ed from.  The kernel namei() could do
lookups relative to this inode just like it can now for root
"/" and cwd "./".  The only sticky issue would be in deciding
what special filename character should be used for this.
Something like "@" used as a component on it's own at the
beginning of a path would be OK with me.

e.g.	open("@/default.rc", O_RDONLY)

Any takers ?

Made in New Zealand -->  Brent Callaghan  @ Sun Microsystems
			 uucp: sun!bcallaghan
			 phone: (415) 691 6188



More information about the Comp.unix.wizards mailing list